Close Window with window.close in Javascript
To close a window with window.close in Javascript:
<a href="#" onclick="javascript:window.close()">Close Window</a>
or
<a href="#" onclick="javascript:self.close()">Close Window</a>
To avoid the Internet Explorer warning message, open the window with Javascript's
window.open method.
<a href="#" onclick="javascript:window.open('test2.shtml');return false">Open Window</a>
Then in your test2.shtml place your window.close link:
<a href="#" onclick="javascript:window.close()">Close Window</a>
Free Copy and Paste Javascript Code:
<a href="#" onclick="javascript:window.open('test2.shtml');return false">Open Window</a>
<a href="#" onclick="javascript:window.close()">Close Window</a>
Resources:
Opening a REMOTE WINDOW in Javascript
Click HERE to comment or discuss at iLoveTheCode GOOGLE Group
CSS David McFarland | | |
| | | |
| | | |