Using window.open in safari

Normally window.open will open a new window in firefox, chrome and IE. However, when I use this function in safari the link opens up in the same window meaning that the current page is lost. How can I fix this?

Try this

window.open('http://www.google.com', '_blank');

Where window.open opens the new page is under your visitor’s control. many people have it set to open a new tab in whichever browser they are using and some people have it set to always just replace the current page. You have no control over anything outside of the current web page if your visitor decides to restrict your access and with some browsers they can even override the JavaScript that you have within the page.

If it is happening in your own browser and you want it to behave differently to how it is then you need to check what browser settings that you have set up that relate to JavaScript operation. There may also be plugins/extensions in the browser that can affect the behaviour.

Thanks for the suggestions. I figured out the problem. My window.open was on a link and I thought e.preventDefault would prevent use of the normal link but I had to use return false instead.