Javascript solution for post:
function openWindowWithPost(url,name,keys,values)
{
var newWindow = window.open(url, name);
if (!newWindow) return false;
var html = "";
html += "<html><head></head><body><form id='formid' method='post' action='" + url + "'>";
if (keys && values && (keys.length == values.length))
for (var i=0; i < keys.length; i++)
html += "<input type='hidden' name='" + keys[i] + "' value='" + values[i] + "'/>";
html += "</form><script
type='text/javascript'>document.getElementById(\"formid\").submit()</script></body></html>";
newWindow.document.write(html);
return newWindow;
}
works in IE and firefox
本文介绍了一个JavaScript函数,该函数能够打开一个新窗口并使用POST方法发送数据。此方法适用于Internet Explorer和Firefox浏览器。
254

被折叠的 条评论
为什么被折叠?



