Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

open multiple webpages in same tab

Have multiple hyperlinks in a report, everytime a click on a hyperlink the webpage opens in a new tab, Is it possible to open the hyperlinks in only one tab instead of multiple tabs using javascript ? Please help

I am currently using window.open to open the webpages, I cannot use target. Below is the code :

    I basically have a jqgrid where all the values of a column have hyperlink,

    if (GridColNum == 2) //index of the column
    {
    localStorage.valuekey = $('#filters_grid').jqGrid('getCell', GridRowId, 1);
    window.open('http://mywebpage.html'); 
    }

And i am using the clicked value in another page using localstorage feature

like image 755
Suri Avatar asked Jun 03 '26 08:06

Suri


1 Answers

Yes, it's possible. Use syntax

<a href="..." target="rptTab"/>

for all relevant links. This way the first time a link is clicked a new tab will be opened; for subsequent clicks, that tab will be reused.

EDIT: if you're opening the link in javascript using window.open, then you need to specify the name of the tab/window as the second parameter:

window.open('http://mywebpage.html', 'rptTab');
like image 134
Aleks G Avatar answered Jun 05 '26 02:06

Aleks G