• Translate

9/21/2016

How to Use Jquery External Link Rel Nofollow And Open New Tab

Tutorial Blogspot |

Advertisement

How to Use Jquery External Link Rel Nofollow And Open New Tab | Nofollow is the value for the rel attribute in an HTML element that aims to instruct search engines to not explore the link so it does not affect the ranking in the search engine index. Usually rel="nofollow" added to the external links or links that lead to the outside of the website or blog.

To make it easier to add rel="nofollow" on external links automatically, we could use jquery. It is useful to overcome the external links were added outside of our control such as in a forum that allows members to create posts. Thus, although members of the forum made a post by applying an external link, then the link will automatically add rel="nofollow".

How to Use Jquery External Link Rel Nofollow And Open New Tab

To use an external jquery rel nofollow link, please copy the code below and save the above code </body> and make sure we've put that script library jquery his work. In addition to adding rel="nofollow", this script also add target="_blank" so that external links open in a new tab when a link is clicked.
<script type='text/javascript'>
//<![CDATA[
$("a").filter(function(){return this.hostname&&this.hostname!==location.hostname}).attr('rel', 'nofollow').attr('target', '_blank');
//]]>
</script>
Hopefully Tutorial external link rel nofollow jquery helpful for you

Disqus
Blogger
Comment
How to style text in Disqus comments Top Disqus Commentators
  • To write a bold letter please use <strong></strong> or <b></b>.
  • To write a italic letter please use <em></em> or <i></i>.
  • To write a underline letter please use <u></u>.
  • To write a strikethrought letter please use <strike></strike>.
  • To write HTML code, please use <code></code> or <pre></pre> or <pre><code></code></pre>, and please parse the code in the parser box below.
Show Parser Box

No comments Add Comment

Comments not appropriate topic will sign SPAM.