USA

Service Channels

  #1  
Old Nov 1st, 2009, 06:48 PM
JavaScriptBank JavaScriptBank is offline
Registered User
 
Join Date: Jul 2009
Posts: 13
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
	-->
Step 2: Copy & Paste HTML code below in your BODY section
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
	-->





Reply With Quote
  #2  
Old Nov 5th, 2009, 11:45 AM
Wrams Wrams is offline
Registered User
 
Join Date: Sep 2009
Posts: 9
Nice find. However, will this work when Javascript is turnt off in the browser? Just wondering thats all.
__________________
Cheap Web Hosting
Reply With Quote
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

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:36 PM.



Advertisements


Popular Countries




Choose a letter




Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright 2009 Serchen Limited