External Link Disclaimer

  • Updated

This KB article shows you how to add an "exit disclaimer" to external links on a page.

 

  1. You can have "NOTE: External link" after every external link.
  2. You can use JQUERY to automatically add alerts or call another function when pressing the link.

    Here are some examples.

    You only need to assign class="external" to the external links.

    $("a.external").click(function () {
      alert("Note: You are leaving this website");
    });
    

    Another example:

    $('a').filter(function() {
        return this.hostname && this.hostname !== location.hostname;
      })
      .click(function () {
      var x=window.confirm('You are about to proceed to an offsite link.  My site has no control over the content of this site.  Click OK to proceed.');
            var val = false;
            if (x)
                val = true;
            else
                val = false;
            return val;
    
            });
    
  3. You could do this where JQUERY would go.