July 2, 2011

Tutorial: New Tab Without Right Click

Assalamualaikum wbt,

This tutorial is perfect for people who don't like to use the right click to open a new tab, people like me.

1. Dashboard -> Design-> Add a Gadget -> HTML/Javascript
2. Copy the code below and paste it in the box.

<!-- code for turning all non-blog links to new page links -->
<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 URL") < 0 //not links that are 'inside' blog
&& arr[i].href.indexOf("javascript:") < 0) //not javascript links
arr[i].target = "_blank";

Click save and now you're down. So simple I don't know what to say.

No comments:

Post a Comment

~ Mind your words. I ain't dealing with rude people. ~