You have to make links open in new window to make visitors staying on your site. Because if a link opens in the same window the visitors leave your site and pay attention to that site (clicked link).
I search for the code to implement that in this blog I found five methods. I would like to share them here. The following methods will work for websites too.
In the sidebar you may link your favorite websites and in blog posts you may link related websites. For that the following two methods available.
This will open google.com in a new blank window. We link google.com in the text Google.
To open all links of your blog in new window the following two techniques are available.
The following is a special technique.
In the sidebar you may link your favorite websites and in blog posts you may link related websites. For that the following two methods available.
Open a Specific Link in Blank Window:
If you click the link every time it will open in a new blank window. Use the following code.<a href="http://www.google.com/" target="_blank">Google</a>
Open a Specific Link in Already Opened Window:
That means for the first time if you click a link it will open in new window. Next time if you click any link it will open in the same new window you already opened. This will look good. Because opening every link in a new blank window may irritate users. The code is given below.<a href="http://www.google.com/" target="_new">Google</a>
Open All Links in Blank Window:
Put the following code after the <head> tag in your blogger template and save the template.<base target='_blank' />
Open All Links in Already Opened Windows:
Put the following code after the <head> tag in your Blogger Template and save the template.<base target='_new' />
Open all External Links in New Window:
If you want to open internal links (your blog links) in the same window and external links (links of other websites) in new window put the following code after the <head> tag and save your template.
<!-- start of external links new window -->
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js' type='text/javascript'/>
<script type='text/javascript'>
$(document).ready(function () {
$("a[href*='http://']:not([href*='"+location.hostname+"']),[href*='https://']:not([href*='"+location.hostname+"'])").attr("target","_blank").attr("title","Opens new window").addClass("external");
});
</script>
<!-- end of external links new window -->
For editing your blogger template the following post will help you<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js' type='text/javascript'/>
<script type='text/javascript'>
$(document).ready(function () {
$("a[href*='http://']:not([href*='"+location.hostname+"']),[href*='https://']:not([href*='"+location.hostname+"'])").attr("target","_blank").attr("title","Opens new window").addClass("external");
});
</script>
<!-- end of external links new window -->
Tidak ada komentar:
Posting Komentar