Closing a Window
Just as you can create windows, you should know how to get rid of windows by closing them. In Script 6.8, the parent window has “open” and “close” links that create and close the child window, and each link has a unique id that we use in the script. The external JavaScript is in Script 6.9.
To close a window:
1. | var newWindow = null; |
2. | document.links[i].onclick = chgWindowState; |
Get JavaScript and Ajax for the Web: Visual QuickStart Guide, Seventh Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.