How to get URL of a popup login window?
Ask by Revati S Misra
Updated 20 Jul 2023
There are a few ways to get the URL of a popup login window.
One way is to use the
window.open()method. Thewindow.open()method takes two arguments: the URL of the window to open, and a name for the window. The following code opens a new popup window with the URL of the login page:Once the popup window is open, you can get the URL of the login page by using the
window.location.hrefproperty. Thewindow.location.hrefproperty returns the URL of the current window. The following code gets the URL of the login page:Another way to get the URL of a popup login window is to use the
window.nameproperty. Thewindow.nameproperty returns the name of the current window. The following code gets the name of the popup window:Once you have the name of the popup window, you can get the URL of the login page by using the
window.opener.location.hrefproperty. Thewindow.opener.location.hrefproperty returns the URL of the window that opened the current window. The following code gets the URL of the login page: