Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jquery open url in new tab

I'm making a personal script to search google in another language and I've got a url that I've passed from a php script. I want to use jquery to open that url in a new tab (only in google chrome).

I tried:

  window.open("http://localhost/123", '_blank');

It unfortunately Opens in a new window in google chrome, which is unfortunately the only browser that's light enough to use on my computer. I don't seem to have any success googling it so any advice would be much appreciated.

Thanks Sam

EDITED: Sorry if your not meant to edit like this but my new question is (I should probably ask it somewhere else):

How to edit google chromes config to open a new tab instead of a window when window.open("href", "_blank") is called?

like image 412
killkrazy Avatar asked Oct 23 '11 16:10

killkrazy


1 Answers

You can't directly control this, because it can be configured by the user. You might try "_newtab" which might work for Firefox but really you shouldn't rely on a new tab being opened. The user may have their browser settings set to open a new tab when a popup window is opened or it may show up as a popup. It just all depends on the browser settings.

like image 173
Adam Avatar answered Oct 21 '22 07:10

Adam