is there any script to set all external links to open in new page?
Printable View
is there any script to set all external links to open in new page?
Code:<a target="_blank" href="http://www.domain.com">Link</a>
Btw, may I suggest using google before asking. We are no substitute for the power of google...
Indeed. There aren't many questions asked on this forum to which Google has no answer http://www.mcbriens.net/liam/img/smilies/notworthy.gifQuote:
Originally posted by I.am@10 May 2004 - 09:34
Code:<a target="_blank" href="http://www.domain.com">Link</a>
Btw, may I suggest using google before asking. We are no substitute for the power of google...
setting one link a time is easy but if u have lots of links that u want them to open in new page will be hard to set them one by one so i want some kind of code or script that sets all external links to open in new page.
Find and replace :)Quote:
Originally posted by bawa@Klite_user@10 May 2004 - 09:38
setting one link a time is easy but if u have lots of links that u want them to open in new page will be hard to set them one by one so i want some kind of code or script that sets all external links to open in new page.
To open all links of your page in a new window,
Put this between <head> </head>
Code:<base target="main">
Use your <head> wisely. :P
thats easy but i dont want ma own page links like menu links to open in new page only external links like a link to a other site to open in new page
Post your source...Quote:
Originally posted by bawa@Klite_user@10 May 2004 - 09:56
thats easy but i dont want ma own page links like menu links to open in new page only external links like a link to a other site to open in new page
I can write a script that opens the specified url in the new window whenever you call it. But its useless. You still have to give the function in onclick of the link so why not just take a step back and add the target as well.
Btw, FYI in html 4.01 target field is deprecated. They added a "rel" instead.
eg:
Code:<a href="page.html" rel="external">Page</a>