var aform = document.createElement('form'); aform.method='post';
aform.action='test.jsp';
var a=document.createElement('input');
a.type='hidden';
a.name='p1';
a.value='工要在地';
aform.appendChild(a);
document.body.appendChild(aform);
aform.submit();类似这样的提交方式,但是要求test.jsp是在模态窗口中打开
一定要是post方式提交,get不行,因为我要提交的数据比较多,get方式很可能会超长
高手快来吧
aform.action='test.jsp';
var a=document.createElement('input');
a.type='hidden';
a.name='p1';
a.value='工要在地';
aform.appendChild(a);
document.body.appendChild(aform);
aform.submit();类似这样的提交方式,但是要求test.jsp是在模态窗口中打开
一定要是post方式提交,get不行,因为我要提交的数据比较多,get方式很可能会超长
高手快来吧
不想再去查一次
aform.action='test.jsp';
aform.target = 'target_name';
var a=document.createElement('input');
a.type='hidden';
a.name='p1';
a.value='工要在地';
aform.appendChild(a);
document.body.appendChild(aform);
aform.submit();
只能在打开的模态对话框中,进行检索之类的操作,或者把主窗口的window对象传过去,然后在子窗口再取父窗口的值.
如
window.showModalDialog("page.htm",data);其中data就是你要传的数据,可以转成json对象传送。
但在page.htm中有个要注意的地方,就是在page.htm中内嵌一个iframe,然后form的target设为该iframe的name值
也就是说在这个iframe中打开test.jsp
如果直接在form的target中指定为"_self"的话,在window.open打开的页面中是可以的,但在window.showModalDialog中就一定会打开一个新窗口
也就是说通过window.showModalDialog打开的page.htm是绝对不可被替换成其它url的。