Monday, February 14, 2011

Open External link with new tab in your blogger

This will help you to open your every external link
with new tab.try this.
1. Log in to your blogger account and go to  Design >>  Edit HTML

2. Find this tag By using Ctrl+F          </head>

3. Paste below code before the </head>   tag

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
 <script type="text/javascript">
   
$(document).ready(function () {

            // ---- External Links ----------------------------------------------------------------------------------------------------

                $("a[href*='http://']:not([href*='"+location.hostname+"']),[href*='https://']:not([href*='"+location.hostname+"'])").attr("target","_blank").attr("title","Opens new window").addClass("external");

    });
    </script>

4. now click preview and click save template. you are done.

14 comments:

  1. Thanks man, it really worked. i will apply this code to all of my blogs.

    here is the demo link > http://cellphonedesigns.blogspot.com/

    ReplyDelete
  2. Thank you so much. Very simple to do, and it works.

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete
  4. I'm back... This works fine in the latest Firefox, Opera, Safari and Chrome, but there seems to be a problem with Internet Explorer.

    It works with IE8, which I have on an old Windows XP laptop, but just opens a new blank tab with IE9 on my Windows 7 laptop.

    I use Firefox, myself, but of course, many who visit blogs will have IE as their default browser.

    Is there any way round this?

    ReplyDelete
  5. Andrew Graeme GouldMay 8, 2011 at 9:46 AM

    I forgot. With IE9, commenter's link backs to their blogs don't work, either.

    ReplyDelete
  6. I dont know why its not working for my page...it says code not be parsed

    ReplyDelete
  7. thanks...its really work in my blog..
    thank you so much..

    ReplyDelete
  8. sir please help me

    i try this code it works but the side effects is after placing that code my submenu is not openning please view this

    http://trixmania.blogspot.com

    all submenus in pagemenu is not opening.. like BLOGGER>> , SMART >>

    ReplyDelete
  9. Thank you very much. Working fine for my blog http://ebeautifulworld.blogspot.com/

    ReplyDelete
  10. Very nice post and with the help of this every blogger can reduced their blog bonus ratio.

    ReplyDelete
  11. This is really cool. Now my blog can also act as a professional website, as far as the 'external link opening' is concerned. :)

    ReplyDelete
  12. wow its working fine in Google crome in India
    Thnx dude

    ReplyDelete
  13. This is perfect! Every other website makes it seem so difficult and complicated. This was exactly what I wanted! Thanks!!!!

    ReplyDelete