0

I have a web application where I have four/five icons in the default page. On click of these icons i am redirecting to some URL in new tab of already opened chromium browser instance using javascript. Below is the javascript code snippet that I am using to launch the URL in new tab of already opened chromium browser instance. Here I am manually clicking the icon

window.open(myURL, '_blank');

But the issue is when I am trying to open the same URL using the same code and programatically triggering the same code to open the URL in new tab, it opes up as a Pop Up but not in a tab. Below is how I am trying to pragmatically open the URL. I am calling the click event of the Icon in the default page using some script rather than manually clicking the icon.

$('#myIconId').click();

If somebody could please help me out. TIA

1 Answers1

0

give a try to use

<a href="some url" target="_newtab">content of the anchor</a>

Although You shouldn't force user to open new pages or new tab without showing them a hint on what is going to happen before they click on the link.

Above code may or may not work on all browser, please test before making live.

UPDATE

Ref : Programmatically open new pages on Tabs

Community
  • 1
  • 1
Sunil Verma
  • 2,490
  • 1
  • 14
  • 15
  • 1
    I don't think `_newtab` is some modifier attribute. You may very well use `_blahblah`. – Abhitalks Dec 10 '13 at 13:18
  • Thanks for the link. (1) that link is not a reference, just an answer on another question i.e. it is not authoritative. (2) did you read the last comment on that answer? ;) – Abhitalks Dec 10 '13 at 13:27