Skip to content Skip to sidebar Skip to footer

Javascript Popup Reloads Parent Page -

I have a popup function in a program that works well, be re-loads the parent page as it loads the child. Is there a way to prevent this behaviour. // popup window function function

Solution 1:

My guess is that you do not cancel the default behavior of the link that triggers the popup:

<a href="foo.html" onclick="newPop();">Foo</a>

should be

<a href="foo.html" onclick="newPop(); return false;">Foo</a>

or (as newPop() always returns false):

<a href="foo.html" onclick="return newPop();">Foo</a>

Post a Comment for "Javascript Popup Reloads Parent Page -"