![]() ![]() Technically, the close() method is available for any window, but window.close() is ignored by most browsers if window is not created with window.open(). If we don’t need a popup any more, we can call newWindow.close() on it. If that’s not so, then there are still means to communicate, to be covered in the next chapter Cross-window communication. They may modify each other freely assuming that they come from the same origin. So both the main window and the popup have a reference to each other. #Javascrip popup window windowsIt is null for all windows except popups. A JavaScript in it may use window.opener to access the window that opened it. Accessing the opener windowĪ popup may access the “opener” window as well. That’s for user safety, so that an evil page can’t open a popup with and read the data. Please note that external document content is only accessible for windows from the same origin (the same protocol://domain:port).įor windows with URLs from another sites, we are able to change the location by assigning newWindow.location=., but we can’t read the location or access the content. Let’s open a window with minimal set of features just to see which of them browser allows to disable: There is also a number of less supported browser-specific features, which are usually not used.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |