<script language="javascript">
function newForm(uname){
    var newForm = document.createElement("FORM");  
    newForm.id = "newForm"; 
    newForm.name = "newForm";   
    newForm.action = "result.html"
    newForm.method = "post";   
    newForm.target = "_blank";
    
    newForm.innerHTML += "<input type=\"text\" name=\"uname\" value=\"" + uname +"\">";
    document.body.appendChild(newForm);
    newForm.submit();
document.body.removeChild(newForm);
}
</script><a href="#" onclick="newForm('zhangsan');return false;">提交</a>
不影响原来的页面的情况下在新的页面中打开result.html,不能是在新选项卡中打开。而且要求result.html没有菜单栏、状态栏、地址栏等等,还要设定result.html的大小。

解决方案 »

  1.   


    <script language="javascript">
    function newForm(uname){
        var newForm = document.createElement("FORM");  
        newForm.id = "newForm"; 
        newForm.name = "newForm";   
        newForm.action = "result.html"
        newForm.method = "post";   
        newForm.target = "_blank";    var win = window.open('', 'newWindow', 'width=400,height=300');
        newForm.target = 'newWindow';    newForm.innerHTML += "<input type=\"text\" name=\"uname\" value=\"" + uname +"\">";
        document.body.appendChild(newForm);
        newForm.submit();
        document.body.removeChild(newForm);
    }
    </script><a href="#" onclick="newForm('zhangsan');return false;">提交</a>
      

  2.   

    result.html没有滚动条啊,想要有滚动条怎么办啊?
      

  3.   

    我知道了 这样就行了:var win = window.open('', 'newWindow', 'width=430,height=300,scrollbars=yes');
    谢谢!!!