比如:a弹出b
bwindow_nm=window.open(YourURL,"window_nm");
a内控制b;bwindow_nm.YourControl_In_B;
b内控制a:window.opener.YourControl_In_A;
bwindow_nm=window.open(YourURL,"window_nm");
a内控制b;bwindow_nm.YourControl_In_B;
b内控制a:window.opener.YourControl_In_A;
a内控制b:如果b是从本机上的文件打开的窗口就可以成功
如果b是internet上的一个网址就行不通了
在 new_window 中调用 parent_window的方法是:
window.opener 或window.parent
假如控制方法是control(), 那么可以写成:
window.opener.control() 或 window.parent.control()以下是window对象的属性和方法参考:Properties
.defaultStatus Reflects the default message displayed in the window's status bar .frames An array reflecting all the frames in a window .length Reflects the number of frames in a parent window .name Reflects the windowName argument .parent Refers to a window containing a <FRAMESET> tags .self Refers to the current window .status Specifies message to display in the window's status bar .top Refers to the top-most Navigator window .window Refers to the current window .document Refers to the document on display within the window .frame Refers to an independently-scollable frame created with a <FRAME> tag .location Contains information on the URL of the document displayed in the window
Methods
.alert("msg") Displays a JavaScript alert message box with msg and OK button .close() Closes the window confirm("msg") Displays a JavaScript confirm message box with msg and OK and Cancel buttons .open("URL", "windowName", ["windowFeatures"]) Opens a window displaying URL with windowName as target name and optional windowFeatures prompt("msg",["default"]) Displays a JavaScript prompt box with msg and optional default text timerID = setTimeout(exp,msec) Delays execution of expression msec milliseconds clearTimeout(timerid) Cancels timerid created by setTimeOut()