in JS, the steps for passing parameters via "post" are as follows: window.open
such as: In the a.jsp has a JS method Winow.open, the target address is xx.do
1, build a form in a.jsp, the value to be set by JS Dynamic Add to the inside, such as:
$ ("#postForm"). Append (' <input type= "hidden" name= "query.id" value= ""/> ");
2. Set the target property of the form:
$ ("#postForm"). attr ("Target", "Newwin");
3. Set the action of the form:
$ ("#postForm"). attr ("Action", "<%=path%>/xx/xx.do");
4, window.open:
window.open ("About:blank", "Newwin", "" ");//newwin is the target of the form above
5. Submit the form:
$ ("#postForm"). Submit ();
OK, after completing the above 5 steps, the complete JS method is as follows:
function Openwin () { $ ("#postForm"). HTML (");//prevents elements from repeating $ (" #postForm "). Append (' <input type= ' hidden ' name= "Query.id" value= "/>"); $ ("#postForm"). attr ("Target", "Newwin"); $ ("#postForm"). attr ("Action", "<%=path%>/xx/xx.do"); window.open ("About:blank", "Newwin", "" ");//newwin is the target $ (" #postForm ") of the form above. Submit ();
reprinted from : http://www.thinksaas.cn/news/show/431/
window.open passing parameters via "post" in JS