
Friday, 12 July 2013 @ 20:58
Ello. I am making a tutorial about the automatic
open new tab thing. I don’t use this one because I think it mess with the PC I’m
using. It crowds Chrome as well. But just in case if you guys wanted to use
this for your blog.
For your information, this is for the simple
template users only. I am going to post for the design template users in the
future.
First thing first. Copy the code below:
<!-- 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";
}
</script>
P/S :
Automatic open new tab means it will open a new tab when you click one link.

0 Comments:
Post a Comment