USA

Service Channels

  #1  
Old Nov 1st, 2009, 05:48 PM
JavaScriptBank JavaScriptBank is offline
Registered User
 
Join Date: Jul 2009
Posts: 86
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, 10: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
Exchange links with other sites alz Serchen Interactive - Community Chat 14 May 20th, 2010 07:39 AM
Sun Microsystems' Open Cloud Platform To Take On Microsoft, Google And Amazon NewsDesk Software as a Service (SaaS) News 0 Mar 19th, 2009 05:14 AM
Sun Open Sources Solaris Cluster and Builds a New Community at OpenSolaris.org NewsDesk Web Hosting & Internet News 0 Jul 3rd, 2007 03:04 AM
Advanced Link Building: Hosted Content, The Quest for the Perfect Link NewsDesk Web Hosting & Internet Articles 0 Apr 12th, 2007 09:48 AM
LinksCitadel.com Provides Automatic Link Exchange for Web Sites NewsDesk Web Hosting & Internet News 0 Jan 17th, 2006 03:43 AM


All times are GMT -6. The time now is 11:41 PM.



Advertisements


Popular Countries




Choose a letter




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