Tutorial : Link At New Tab


Hello semua, it's tutorial time !
Tuto hari ni senang kot..

Firsty, mcm biasa la kan.
Dashboard > Design > Page Element > Add A Gadget
then pilih HTML/JavaScript

Secondly, copy code kat bwh nih then paste kan dekat ruang 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>


perasan tak ada code yg tulis Your URL tuh ?
em, code tu tak payah tukar pun tak apa...
then tekan aje Save..
Good luck keyh ?
Goodbye !!!

1 ulasan: