open link dekat new tab

5:22 PM

Assalamualaikum.
Entry kali ni is about open link dekat new tab.

Classic Template


1. Dashboard > Edit Template HTML.
2. Copy code kat bawah ni dan Paste dekat ATAS </body>

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



    <script type="text/javascript">
3. Dah siap. SAVE dan tengok hasilnya ^_^



Design Template

1. Dashboard > Add Gadget > HTML/JAVASCRIPT 
2. Copy code kat bawah ni dan paste dekat HTML/JAVASCRIPT 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";
       }
    </script>
 3. Dah siap. SAVE dan tengok hasilnya ^_^
the end
^_^
by.hudahud
smile.smile.smile
^_^

You Might Also Like

4 comment di sini.

  1. awk di tag (:

    aini-mohamad.blogspot.com

    ReplyDelete
  2. ok dh jdi, kna guna yg design template bru jdi, clasic template tak jdi, btw thx a lot :)

    ReplyDelete