|
#1
|
|||
|
|||
|
Make link open in new tab/window
Use this simple JavaScript to make all links on your web pages open in new tab/window. Script is easy to setup, you should save them into a f... detail
How to setup Step 1: Use JavaScript code below to setup the script JavaScript Code:
<script language=javascript>
/*
Kevin Yank
http://www.sitepoint.com/authorcontact/48
*/
function externalLinks()
{
if (!document.getElementsByTagName) return;
var anchors = document.getElementsByTagName("a");
for (var i=0; i<anchors.length; i++)
{
var anchor = anchors[i];
if(anchor.getAttribute("href"))
anchor.target = "_blank";
}
}
window.onload = externalLinks;
</script>
<!--
This script downloaded from www.JavaScriptBank.com
Come to view and download over 2000+ free javascript at www.JavaScriptBank.com
-->
HTML Code:
<a href="http://javascriptbank.com/">Home</a> |
<a href="http://javascriptbank.com/4rum/">Forum</a> |
<a href="http://javascriptbank.com/javascript/">JavaScript</a> |
<a href="http://javascriptbank.com/service/">Services</a> |
<a href="http://javascriptbank.com/javascript/submit-javascript-bank.html">Submit script</a> |
<a href="http://javascriptbank.com/thietkeweb/javascriptmall/">Documentary</a> |
<a href="http://javascriptbank.com/javascript/contact-javascript-bank.html">Contact us</a> |
<a href="http://javascriptbank.com/javascript/aboutus-javascript-bank.html">About us</a>
<!--
This script downloaded from www.JavaScriptBank.com
Come to view and download over 2000+ free javascript at www.JavaScriptBank.com
-->
|
|
#2
|
|||
|
|||
|
Nice find. However, will this work when Javascript is turnt off in the browser? Just wondering thats all.
__________________
Cheap Web Hosting |
![]() |
| Bookmarks |
«
Previous Thread
|
Next Thread
»
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Sun Microsystems' Open Cloud Platform To Take On Microsoft, Google And Amazon | NewsDesk | Software as a Service (SaaS) News | 0 | Mar 19th, 2009 06:14 AM |
| Exchange links with other sites | alz | Serchen Interactive - Community Chat | 10 | Dec 27th, 2007 11:13 PM |
| Sun Open Sources Solaris Cluster and Builds a New Community at OpenSolaris.org | NewsDesk | Web Hosting & Internet News | 0 | Jul 3rd, 2007 04:04 AM |
| Advanced Link Building: Hosted Content, The Quest for the Perfect Link | NewsDesk | Web Hosting & Internet Articles | 0 | Apr 12th, 2007 10:48 AM |
| LinksCitadel.com Provides Automatic Link Exchange for Web Sites | NewsDesk | Web Hosting & Internet News | 0 | Jan 17th, 2006 04:43 AM |
All times are GMT -6. The time now is 09:35 PM.









Linear Mode



