首页 > 代码库 > JS弹窗数据带回

JS弹窗数据带回

父窗口代码:

function selectCar_Team_Info(){       //var url = "<%=basepath_%>ec/jsp/carLoading/carTeamPopInfo.jsp";       //var obj = window.showModalDialog(url,null,"dialogWidth=600px;dialogHeight=400px;resizable=yes");       window.open("<%=basepath_%>ec/jsp/carLoading/carTeamPopInfo.jsp","carTeamInformation","width=500px,height=430px,top=400px, left=500px,scrollbars=yes" );      /*  if(obj!=undefined && obj!=null){              $("#teamName").val(obj.name);           $("#fk_car_team_info_id").val(obj.id);       } */   }   //信息带回    function backsPort(id,name){        //alert(id+"---"+name);        if(id!=null && name!=null){            $("#teamName").val(name);            $("#fk_car_team_info_id").val(id);        }    }

子窗口:

function selectb(id,value){        /*  这样360浏览器不兼容            var obj = {};             obj.id=id;             obj.name=value;            window.returnValue=http://www.mamicode.com/obj;>*/        //2016-6-13        window.opener.backsPort(id,value);        window.close();    }

 

JS弹窗数据带回