87,910
社区成员
发帖
与我相关
我的任务
分享
<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>
<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>