submit();    
是不是后边中文分号的问题?

解决方案 »

  1.   

    一个是小梅说的分号
    还有
    frames['sub_content_prvw'].document.getElementById('sub_prvw').action = 'wap_page.php?op=editor_save_prvw&id'+id; 
    这句改下
    frames['sub_content_prvw'].document.sub_prvw.action
      

  2.   

    function c_editor_save_prvw()调用了吗?
      

  3.   

    to  zhaoxiaoyang(梅雪香@深圳):
    中文分号“;”是帖帖子时的笔误,我的文件中是正确的英文分号,但是submit()还是失败的。to hbhbhbhbhb1021(天外水火(我要多努力)):
    改为frame_name.document.form_name.action也不行。to chouchy(城市刀客):
    确定c_editor_save_prvw()是调用了。
      

  4.   

    参考PAGE A: 
    <script> 
    var iframeObj = document.getElementById("workFrame"); 
    function changeDiv(){ 
    iframeObj.src="url page b"; 

    function changeFrom(){ 
    document.formName.target="workFrame"; 
    document.formName.submit(); 

    </script> 
    <input type="button" name="" value="Change Div" onclick="changeDiv();"> 
    <input type="button" name="" value="Form div" onclick="changeFrom();"><DIV id="divId"> 
    Main page Content 
    </DIV> 
    <Form id="formId" name="formName" action="url page b"></Form> 
    <iframe id="workFrame" width="0" height="0" src="">PAGE B ,iframe result page:<DIV id="divId"> 
    iframe page result content . 
    </DIV> 
    <script> 
    try{ 
    var div = document.getElementById("divId"); 
    var parent_div = parent.document.getElementById("divId"); 
    if(div){ 
    parent_div.innerHTML = div.innerHTML; 

    }catch(e){ 
    alert(e); 

    </script>
      

  5.   

    谢谢cloudgamer(欢迎交流qq215754452)!但我觉得参考价值不大啊
      

  6.   

    搜索到这么一篇帖子:
    http://topic.csdn.net/t/20050326/02/3882421.html然后,我尝试修改我原来的c_editor_save_prvw()函数和sub_content_prvw.php文件分别如下:function c_editor_save_prvw()
    {
    var str = "<{$action}>";
    var id = str.substring(str.lastIndexOf('='), str.length); frames['sub_content_prvw'].document.getElementById('content_p').value = frames['x'].document.body.innerHTML.replace(/<!---->/g, '');    //有值,并且正确
    alert(frames['sub_content_prvw'].document.getElementById('content_p').value);    //for test
    frames['sub_content_prvw'].document.sub_prvw.action = 'wap_page.php?op=editor_save_prvw&id'+id;    //地址是对的,浏览器中单独执行此地址没问题
    alert(frames['sub_content_prvw'].document.sub_prvw.action);    //for test
    frames['sub_content_prvw'].document.getElementById('sub_btn').click();    //参考搜索到的帖子,写了这一句,但仍失败
    }
    sub_content_prvw.php的新内容如下:<form id="sub_prvw" name="sub_prvw" method="post">
    <input type="hidden" id="content_p" />
    <input type="button" id="sub_btn" onclick="this.form.submit();" /><!--新加的-->
    </form>
      

  7.   

    回复人:hbhbhbhbhb1021(天外水火(我要多努力)) ( 四星(高级)) 信誉:100  2007-6-7 20:46:43  得分:0
    ?  一个是小梅说的分号
    还有
    frames['sub_content_prvw'].document.getElementById('sub_prvw').action = 'wap_page.php?op=editor_save_prvw&id'+id;
    这句改下
    frames['sub_content_prvw'].document.sub_prvw.action============
    他的代码很是很兼容的。
      

  8.   

    to yueliangdao0608((深圳PHPER.MSN:[email protected]):我已经尝试过这种形式了,但结果还是一样的。
      

  9.   

    我暂时用XMLHTTPRequest解决了,但用的是get方式(xmlhttpObj.open('get', url, true)),所以说存在传输大量数据的问题。
    开始我考虑用隐藏的frame中的form,也是为了避免这个问题。但现在……
      

  10.   

    最终这样解决:function c_editor_save_prvw()
    {
    if((xmlHttp = getXmlHttpObject()) == null) {
    alert('浏览器版本低,请更新或更换您的浏览器');
    return;
    } var str = "<{$action}>";
    var id = str.substring(str.lastIndexOf('='), str.length); var content_p = frames['x'].document.body.innerHTML.replace(/<!---->/g, ''); var url = 'wap_page.php'
    xmlHttp.open('post', url, true);
    xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    xmlHttp.send('op=editor_save_prvw&content_p='+content_p+'&id'+id);
    }
    因为不用隐藏的frame了,sub_content_prvw.php文件也就不需要了