0

jQuery(document).ready(function($) {
  // Open external links in a new window or tab
  $(document).on('click', 'a[rel$="external"]', function() {
    $(this).attr('target', "_blank");
  });
  $(document).on('click', 'a[href$=".pdf"]', function() {
    $(this).attr('target', "_blank");
  });
  // Open all urls that don't belong to our domain in a new window or tab
  $(document).on('click', "a[href^='http:']:not([href*='" + window.location.host + "'])", function() {
    $(this).attr("target", "_blank");
  });
   });

Jagdish Sarma Asked question March 2, 2022
Add a Comment