Page 1 of 1
link creating new page while view page remains active
Posted: Wed Feb 27, 2008 2:33 am
by don_omar
Hi I wanted to find out how I can create code for a link where it opens the page in a new tab or window while the page of which i clicked upon remains active. Any help is greatly appreciated.
Re: link creating new page while view page remains active
Posted: Wed Feb 27, 2008 2:50 am
by EverLearning
in <a> tag you need to set "target" attribute to value "_blank", like this
Code: Select all
<a href="http://some.link.com" target="_blank">Some.Link.Com</a>
Is that what you meant?
Re: link creating new page while view page remains active
Posted: Wed Feb 27, 2008 2:58 am
by don_omar
hi everlearning, thanks for your reply, i got one problem though. i want the page which i was viewing to remain open or active while the page which opens on clicking on the <a> tag to load in the tab in an inactive status (in other words to load while the page i am viewing to remain open. if that is possible
Re: link creating new page while view page remains active
Posted: Wed Feb 27, 2008 3:04 am
by EverLearning
It is possible, but you'll need to use some javascript to do that, and to make sure that the script works correctly for several browsers. Most of the browser already have the ability to open links in background tabs or windows, if user wants to. What do you need that for, anyway?
Re: link creating new page while view page remains active
Posted: Wed Feb 27, 2008 3:13 am
by don_omar
thats exactly what I Want. I want the users to open links without leaving my website. so how do I do it?
Re: link creating new page while view page remains active
Posted: Wed Feb 27, 2008 3:34 am
by EverLearning
Take a look at this link:
http://snippets.dzone.com/posts/show/2915
its a code snippet for what you want, bu also read this:
http://www.thescripts.com/forum/thread586528.html
where someone else wanted something similar, but had problems with browser security settings.
Re: link creating new page while view page remains active
Posted: Wed Feb 27, 2008 3:52 am
by don_omar
Thanks a lot lemme take a look at the snippets.
Re: link creating new page while view page remains active
Posted: Wed Feb 27, 2008 4:37 am
by Inkyskin
This isnt a browsers favourite way of opening windows, it's the same way a lot of old pop-under ad's used to work. Be sure your visitors know that you have opened this window or they may close it thinking its a spam pop-under.