I read a book about javascript and it says that when we create a function for opening a new window, the reference to the new window object is stored inside the variable assigned to the window.open(theURL , newWindow)
call. It also says that if the same variable is used for two or more URLs, no matter which URL I click it would be open in the same window. However, if I create two variables for two window.open()
calls, both sites will open in different (new) windows.
Due to curiosity, I tried to use two different variables, but still when I click both links they are still loaded in the same window. How come? I've tried it on Firefox, IE and Chrome to no avail.