function openPostWindow(url, data, name)
{
var tempForm = document.createElement("form");//建立form表單
tempForm.id="tempForm1";
tempForm.method="post";
tempForm.action=url;
tempForm.target=name;
var hideInput = document.createElement("input");//建立input框
hideInput.type="hidden";
hideInput.name= "mapObj"
hideInput.value= data;//將數據保存到Input框中
tempForm.appendChild(hideInput);
tempForm.addEventListener("onsubmit",function(){ openWindow(name); });//綁定事件
document.body.appendChild(tempForm);
var evt;
if (document.createEvent) { // DOM Level 2 standard
evt = document.createEvent("MouseEvents");
evt.initMouseEvent("onsubmit", true, true, window,
0, 0, 0, 0, 0, false, false, false, false, 0, null);//執行點擊事件
tempForm.dispatchEvent(evt);
} else if (el.fireEvent) { // IE
tempForm.fireEvent('onsubmit');//執行點擊事件
}
tempForm.submit();
document.body.removeChild(tempForm);
}
function openWindow(name)
{
window.open('about:blank',name);
}app