web开发之制作页面弹出窗口(url传参提交)

本文介绍了一个使用JavaScript实现的多页面间数据交互案例。页面A通过弹窗打开页面B并传递参数,页面B收集数据后返回给页面A,再由页面A打开页面C并传递收集的数据。该案例展示了跨页面数据传递的具体实现方法。

功能:弹出一个新页面后,选择条件后继续弹出新的页面进行选择

页面A调用方法

function serchView()
{
    var k;
    var s = new Object(); 
    k=showModalDialog("/procurement_insert_save_search.jsp",s,"dialogWidth:400px;status:no;scroll:no;dialogHeight:330px");
  if (k!=null)
    {
     var url = "/procurementInsertSaveSearchAction.do?depId="+k[0]+"&startDate="+k[1]+"&endDate="+k[2]+"&stId="+k[3]+"&sbId="+k[4]+"&ggId="+k[5];
     window.open(url,'newwindow', 'height=600, width=800, toolbar=no, menubar=no, scrollbars=yes, resizable=no,location=no, status=no');
     
    }   
}

页面B返回方法

function arrayName(size)
{
 this.length=size;
 for(var x=0; x<=size;x++)
 this[x]=0;
 return this;
}
function formsubmit()
{

    var myarray=new arrayName(6);
    myarray[0]=applicationsForm.a.value;
    myarray[1]=applicationsForm.b.value;
    myarray[2]=applicationsForm.c.value;
    myarray[3]=applicationsForm.d.value;
    myarray[4]=applicationsForm.e.value;
    myarray[5]=applicationsForm.f.value;
    window.returnValue=myarray;
    window.close();
}

 

页面C返回方法

function baocun()
{
 selectIDlist = getCheckSelect('fixId');    //得到页面返回值
 var mapps = selectIDlist.split(",");
 var o=window.opener;
 o.document.procurementForm.a.value = mapps[0];
 o.document.procurementForm.b.value = mapps[1];
 o.document.procurementForm.c.value = mapps[2];
 o.document.procurementForm.d.value = mapps[3];
 o.document.procurementForm.e.value = mapps[4];
 o.document.procurementForm.f.value = mapps[5];
 window.close();
}

 

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值