As a newcomer to javascript, I have encountered an issue with the window.open() method that I would like some help with.
In my code, I take a user string, modify it in different ways, and then search for these variations. The intention is to open a new window for each search result. However, I have noticed that the code seems to halt after the first window.open statement. This is the relevant section of my code:
var searchStrings = new Array(url1, url2, url3);
var arrayLength = searchStrings.length;
for (var i = 0; i<arrayLength; i++) {
window.open(searchStrings[i]);
}
I have double-checked the loop using different code to confirm that it iterates through the array correctly. I have also tested by setting the value of i to greater than 0 to try and open the second or third item in the array.
It appears that the window.open method can only be used once. Is this the case, or am I overlooking something in my implementation?