Welcome to My Blog. If you are a New Visitor Please Subscribe For Latest Updates!

How to Open All External Links from Blogger Post in New Window

Rate this Post:
{[['']]}


I am here with New Hack :) If you have many external links in your post, then you should make them open in new window so that your valuable visitors stay on you blog.

I am share a HTML version and JavaScript version for opening links into new window.



Using HTML, when you are writing a post, Click on HTML and find the external link and add the following like after the link;


target="_blank"
For Example <a href="http://www.yourblogname.com/" target="_blank">My Website</a>

This maybe a long process if you have alot of external links,
In that case you can use JavaScript version to do it automatically;

Login Blogger
Page Layout
Add Widget>HTML/JavaScript

And paste the following code and save it


<script type="text/javascript" language="javascript"> var arr = document.getElementsByTagName("a"); //get all links in the page for(var i = 0; i < arr.length; i++) { if(arr[i].href.indexOf("Your Blog URL") < 0 //not links that are 'inside' blog && arr[i].href.indexOf("javascript:") < 0) //not javascript links arr[i].target = "_blank"; }</script>

In Red text Area Paste your blog URL that you don't want to open in new window.

SHARE THIS POST   

  • Facebook
  • Twitter
  • Myspace
  • Google Buzz
  • Reddit
  • Stumnleupon
  • Delicious
  • Digg

0 comments:

Comments will be Moderated by Blog Administrator.
Please do not Spam Here.....