<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的大小。
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的大小。
<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>
谢谢!!!