BTika's Sutra

Btika.com.np With Tech & How To Tips In Simple & Easy Way

Responsive Ads Here

How to open Webpage/Blogger link/ menu in new window

 

How to open Webpage/Blogger link/ menu in new window

 

Website is not complete without clickable link so if link is clicked it opens in the same page so it makes our website home page disappeared and makes the reader to miss our another article of website.  if clicked link is redirected to new tab, there will be higher probability for visitor to come back to our website

 

Just paste below mentioned html code respectively under <head> & <body> tag

 

1.       Go to theme and click on edit HTML and paste below-given code above the </head> tab, to find </head> tag  find it from Ctrl+F in your theme HTML view

 

<script type='text/javascript'>

 $(document).ready(function() {

 $(&quot;a[href^=&#39;http://&#39;]&quot;).each(

 function(){

 if(this.href.indexOf(location.hostname) == -1) {

 $(this).attr(&#39;target&#39;, &#39;_blank&#39;);

 }

 }

 );

 $(&quot;a[href^=&#39;https://&#39;]&quot;).each(

 function(){

 if(this.href.indexOf(location.hostname) == -1) {

 $(this).attr(&#39;target&#39;, &#39;_blank&#39;);

 }

 }

 );

 });

 </script>

2.       Just Paste Blow to code just above the </body>

<script>

//<![CDATA[

(function(d, s, id) {

  var js, fjs = d.getElementsByTagName(s)[0];

  if (d.getElementById(id)) return;

  js = d.createElement(s); js.id = id;

  js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.5";

  fjs.parentNode.insertBefore(js, fjs);

}(document, 'script', 'facebook-jssdk'));

//]]>

</script>


Topics

open website links in new tabs

how to open blogger website menu in new window