Monday, 11 July 2011

TutOriaL: Cara Nak Buat Open in New Tab


Assalammualaikum. kowg faham ke x tajuk 2? hahaha. mksd entry ktowg nie, bile tekan ape saje link dlm blog kowg 2, dye akn open pd window yg baru. so, kalo kowg brminat nk wat cm 2, jom follow entry nie.

1. Log in>Dashboard>Design>Add a Gadget>HTML/Javascript
2. Copy(ctrl+c) code bwh nie n paste(ctrl+v) pada HTML/Javascript


    <!-- 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>


3. Save dan tgk hasilnya. SELAMAT MENCUBA!!

0 comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...