Advertisement
Imperative-Ideas

Open all external links in a blank tab

Jul 9th, 2014
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script>
  2. /*!
  3.  * Automatically rel=nofollow external links and open them in a new tab
  4.  * @author : @imperativeideas
  5.  * @version: 1.0
  6.  */
  7.  
  8. jQuery(function() {
  9.     // Replace imperativeideas.com with your domain name!
  10.     $('a[href^="http://"]').not('a[href*=imperativeideas]').attr({
  11.         'target'    : '_blank',
  12.         'rel'       : 'nofollow'
  13.     });
  14. });
  15. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement