jQuery Plugin That Invisibly Adds An External Window | Externalize

Externalize is a jQuery plugin that subtly adds an external window creation to a set of links that dynamically sets the name, relation, target, and title attributes to links within the document.

A typical use case for this plug-in is to open the external link in a new window, with the rel = “external” attribute.

find urls in text make links javascript, which selector would select only internal links within the current page, jquery check if link is external, javascript detect external link, add target blank to url

How to make use of it:

Installation:

# Yarn
yarn add jquery-externalize

# NPM
$ npm install jquery-externalize

1. Load each jQuery library and the Externalize plugin’s script on the finish of the doc.

<script src="//code.jquery.com/jquery.min.js"></script>
<script src="jquery.externalize.js"></script>

2. Initialize the plugin on the links and completed it.

$('.ref a').externalize();
<a href="#">Externalize Links</a>
<a href="#" rel="external" title="Opens in a new window" target="external">Externalize Links</a>

3. Default configuration choices.

$('.ref a').externalize({

  // (string) name of the external window
  name:     "_blank", 

  // (bool) use the "target" HTML attribute to support Firefox tab handling and Safari status bar info
  target:   true, 

  // (string) apply CSS classes to an external link
  classes:  "", 

  // (string) apply a relationship to an external link
  relation: "external", 

  // (string) text added as or appended to the "title" attribute to inform the user about an upcoming new window
  title:    "Opens in a new window" 

});

jQuery Plugin To Set Rel And Target Attributes For Links, jquery open external links in new tab, which value of the target attribute makes the link open in a new tab or a new window, jquery external link


See Demo And Download

Official Website(Dreamseer): Click Here

This superior jQuery/javascript plugin is developed by Dreamseer. For extra Advanced Usages, please go to the official website.

Related Posts

Iconpicker-Bootstrap-5

[Icon Picker] Iconpicker for Bootstrap 5 Icons Library

Bootstrap 5-based icon picker which supports any icon libraries like Bootstrap Icons, Font Awesome[fontawesome.com], etc. Must Read: 1000+ Pixel Perfect SVG Icons For Vue Components | Unicons How…

bootstrap-multiple-image-upload-with-preview

Bootstrap Multiple Image Upload with Preview and Delete | ImagesLoader

ImagesLoader is a standard bootstrap image upload plugin that provides an easy-to-use and nice-looking interface for uploading multiple images to a web server. Must Read: HTML 5…

Animating-Split-Flap-Displays-fallblatt

A Lightweight jQuery Plugin for Animating Split-Flap Displays | fallblatt

fallblatt is a lightweight jQuery plugin for animating split screens. This jQuery plugin allows you to include such offers in your web application. Everything from virtual departure…

bootstrap-5-dark-theme

Dark & Light Switch Mode Toggle for Bootstrap 5

Switching to dark mode is done by toggling HTML tags that include -dark or -light as a category. It is made by manipulating the DOM with JavaScript. The text color also changes depending…

jQuery-SyoTimer-Plugin

jQuery Plugin for Countdown Timer on HTML Page | SyoTimer

yoTimer jQuery plugin allows you to create digital style countdowns/periodic timers on the webpage, with callbacks support and timezone/translation customization. Features Periodic count with the specified period…

vue-js-periodic-table

Dynamic, Data-driven Periodic Table built with Vue.js

Periodicity is a dynamic, data-driven periodic table created with Vue.js that uses D3 animations and graphs to show the beauty of periodic trends. Built With vue.js (component…