function openPostWindow (url,name, data1, data2)
{
var tempForm = document.createElement("form");
tempForm.id = "tempForm1";
tempForm.method = "post";
tempForm.action = url;
tempForm.target=name;
var hideInput1 = document.createElement("input");
hideInput1.type = "hidden";
hideInput1.name="data1";
hideInput1.value = data1;
var hideInput2 = document.createElement("input");
hideInput2.type = "hidden";
hideInput2.name="data2";
hideInput2.value = data2;
tempForm.appendChild(hideInput1);
tempForm.appendChild(hideInput2);
if(document.all)
{
tempForm.attachEvent("onsubmit",function(){}); //IE
}
else
{
var subObj = tempForm.addEventListener("submit",function(){},false); //firefox
}
document.body.appendChild(tempForm);
if(document.all)
{
tempForm.fireEvent("onsubmit");
}
else
{
tempForm.dispatchEvent(new Event("submit"));
}
tempForm.submit();
document.body.removeChild(tempForm);
}
相关文章
- 10-23模拟post表单提交参数
- 10-23Fiddler 模拟post 提交
- 10-23cURL模拟POST提交数据
- 10-23php模拟post提交请求,调用接口
- 10-23php模拟post提交请求与调用接口
- 10-23C#模拟POST表单提交 --- WebClient
- 10-23C# Get/Post 模拟提交
- 10-23java模拟get/post提交
- 10-23Java中使用多线程、curl及代理IP模拟post提交和get訪问
- 10-23php中curl模拟post提交多维数组(转载)