0

I have a link on my website which creates a pop out window in a CMS page. This work perfectly in Chrome, Oprea and safari but on firefox and IE it creates the pop out window with the correct page. but the main page also redirect to a blank age with [object] on it. This is the code im using to creat the pop out window.

    <a style="position:fixed; z-index:999999999; top:35%; right:0px;"  href="javascript:window.open('needhelp', 'HELP', 'width=500,height=500');">NEED HELP?</a>

I have added an image below of what happens to the main screen on IE and firefox. enter image description here

So my question is how can i create a pop out window without it re-directing the main page?

1

Including JavaScript actions directly in the HTML element is a pretty old-fashioned approach. However, you criticize that an action is taken when a user calls an action (i.e. go to destination given in href). The given destination is the return value of window.open(). That is probably what you see now in the browser's main window.

In order to have only the pop-up opened and not forward to the destination address, just append a return false; to your snippet.

You will find plenty of window.open working examples in Magento's frontend and adminhtml templates.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.