//Click Add to the main page to jump to the Jcxmupdate pagefunctionaddnewdata () {//Center Display varURL = "jcxmupdate.aspx?action=" +actionmethod; varHeight = 280; varwidth = 600; varWin = Openwin (Url, height, width, "no")); Win.focus (); //make the popup page get focus return false;//prevent page Refresh }//Popup PagefunctionOpenwin (Url, height, Width) {vartop = (SCREEN.AVAILHEIGHT-HEIGHT)/2; varleft = (SCREEN.AVAILWIDTH-WIDTH)/2; vartitle = Url.split ('. aspx ') [0].replace (".:", "")); if(title.indexof ('/')! =-1) { varBegin = Title.lastindexof ('/'); Stitle= Title.substr (begin + 1, title.length-begin);//file nametitle =stitle; } varWin = window.open (Url, title, ' height= ' + height + ', width= ' + width + ', top= ' + top + ', left= ' + left + ', toolbar=no, menubar=no, scrollbars=yes, resizable=yes,location=no, Status=no '); returnWin//make the popup page get focus //return false;//prevent page Refresh}
//===========================================//sub-page CloseWindow.onbeforeunload =function () { if(window.opener! =NULL) { //Window.opener.AddRefresh ();Closewin (); } } functionClosewin () {hasclosed=true; Window.opener.location= "javascript:addrefresh ();";//parameters "javascript:addrefresh (" +1+ ");";Window.opener =NULL; Window.close ();
} //Main Page Refresh//refreshfunctionAddrefresh ()//Addrefresh (id) with parameters to parent page pass parameters{ //Alert (id);//document.getElementById ("ctl00_pagebody_button2"). Click ();Document.form1.submit ();}
// the child window gets the value of the parent window var text= window.opener.document.getElementById ("TextBox1"). value;
Alert (text);
JS Popup page Refresh parent page