Open Specific Links In New Windows - jQuery newwindow

File Size: 3.36 KB
Views Total: 1298
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
Open Specific Links In New Windows - jQuery newwindow

newwindow is a super tiny jQuery plugin that opens specific anchor links (typically external links) within the document in the new browser windows or tabs.

How to use it:

1. Link to jQuery library and the jQuery newwindow plugin's script:

<script src="//"></script>
<script src="jquery.newwindow.js"></script>

2. Call the function on the desired anchor links (e.g. nofollow and external links) and done.

<a href="" rel="external"></a>
<a href="" rel="nofollow"></a>

3. The plugin also provides a callback function which will be triggered when the external links are opened.

  open: function (newWindow, e) {
    console.log('Window opened', newWindow, e);

This awesome jQuery plugin is developed by alexrabarts. For more Advanced Usages, please check the demo page or visit the official website.