html - How to open url to the same tab if its already open in browser -
i facing challenge- lets consider have menu , under have 3 links-
about contact faqs
by default home page menu item. when clicking on "contact us" , want open new tab on same browser window. , without closing if again clinking on "contact us" first tab, this time not want open new tab because have open tab contact us
, wanted navigate same 1 earlier opened. how handle scenario in jsp.
is there way this. please me.
you can put name in target go same window/tab
<a href="somerandomurl.com" target="mywindow">contact us<\a>
its not possible control on internet explorer. can change how ie behaves: -internet options -tabs -always open pop-ups in new tab -open links other programs in: new tab in current window
target="_blank"
make sure opens in new window http://www.w3schools.com/tags/att_a_target.asp
it refresh page same url
you can have link return javascript window object , able return window anytime want without refreshing page
var newtab = null; function openwindow(){ if (newtab==null) { newtab = window.open("www.example.com"); } else { newtab.focus(); } }
<a onclick="openwindow()">click me</a>
Comments
Post a Comment