10/21/2011

Link Open in A New Tab Automatically

okay.. so here is my second tutorial fo you all guys...
if you want to keep stay on your page when you click one of the links there.. here u go:
go to:
Dashboard >>Design >>Page Element >>Add Gadget
then choose:
HTML/Javascript
Paste this code below:
<!-- Code for turning all new tab by http://arunnie.blogspot.com/ -->
<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";
}
</script>
ps: if you do use a classic template, then you can place the code above on your layout HTML codes.
go to:
DASHBOARD >>TEMPLATE
then put the code under the:
<title>your blog title here</title>
so,  good luck...

Labels:

0 Comments:


Read this first before proceeding, cause it's important.
So this is how i roll, mate.
1. You don't spam on my comment section.
2. You don't ask for something under my property (for example, codes or photos).
3. You don't come and object all the shits i said in my posts, cause it's MY opinion and thinking.
4. You don't bitch around like you do on other websites.
5. Last of all, be nice. Cause i will give you twice whatever you give to me.

Post a Comment