你想执行script中的动作时提交?

解决方案 »

  1.   

    没有这样做过,你改成如下试试:
    <iframe name="fr1" src="#" width="400" height="300" frameborder="0"></Iframe>
    <script>
    window.frames['fr1'].document.write('<html>');
        window.frames['fr1'].document.write('<head>');
    window.frames['fr1'].document.write('<meta http-equiv="Pragma" content="no_cache">');
     window.frames['fr1'].document.write('</head>');
    window.frames['fr1'].document.write('<body>');
    window.frames['fr1'].document.write('<form name="form1" action="http://www.itgod.cn/pdoaction" method="POST">');
    window.frames['fr1'].document.write('<input type="hidden" name="username" value="test">');
    window.frames['fr1'].document.write('<input type="password" name="passoword" value="test">');
    window.frames['fr1'].document.write('</form>');
    window.frames['fr1'].document.write('<script>');
    window.frames['fr1'].document.write('document.form1.submit();');
    window.frames['fr1'].document.write('<');
    window.frames['fr1'].document.write('/script>');
    window.frames['fr1'].document.write('</body>');
    window.frames['fr1'].document.write('</html>');
    </script>
    <form name="form2" action="http://www.itgod.cn/pdoaction" method="POST">
    <input type="hidden" name="username" value="test">
    <input type="password" name="passoword" value="test">
    <input type="submit" name="sub2" value="action" >
    </form>
      

  2.   

    DeluxWorld(曾经的你):谢谢,试了,不行
      

  3.   

    程序会先执行<form>中的action
    执行你的提交表单,让你重新登陆
    删除这行,试一下!!
      

  4.   

    你有下面这一段,本来载入页面的时候IFRAME里面的页面就会提交的:
    window.frames['fr1'].document.write('<script>');
    window.frames['fr1'].document.write('document.form1.submit();');
    window.frames['fr1'].document.write('<');
    window.frames['fr1'].document.write('/script>');没有什么等待或操作,你就让它执行了 document.form1.submit();
      

  5.   

    你引用iframe的页面不在那个域吧?http://www.itgod.cn/pdoaction??
      

  6.   

    ilvs(天使ηò哭):谢谢,确实不是一个域,这个应该没关系吧?
      

  7.   

    我感觉是不是在action动作的时候,限制了iframe的使用呢?有大虾们遇到过吗?谢谢
      

  8.   

    现在是不是http://www.itgod.cn/pdoaction 不能用了?