Reputation: 53
I have a popup window 'X' generated using javascript window.open()
. When I try to open another child window 'Y' from the pop-up window 'X', i have getting a pop up window 'Y' and also the url of the 'X' reloading to the orignial browser window. Can any one please help me with this?
Upvotes: 1
Views: 679
Reputation: 565
This may be you have not return false
when opening other child window Y from the pop up X window. So your browser is reloading. Try this if still not work post your script if possible!
Upvotes: 1
Reputation: 653
I try with this one and it worked for me:
function openWin()
{
myWindow=window.open('','','width=200,height=100');
myWindow.document.write("<button class='hi' onclick='window.open()'> hi!</button>");
myWindow.focus();
}
<input type="button" value="Open window" onclick="openWin()" />
Upvotes: 1