Adding a hint to indicate links are external


Written on November 27, 2008 – 12:17 am | by mpayne

Good tip from — >
http://www.learningjquery.com/2008/08/quick-tip-dynamically-add-an-icon-for-external-links#more-103

  1. $(document).ready(function() {
  2.   $(‘#extlinks a’).filter(function() {
  3.     return this.hostname && this.hostname !== location.hostname;
  4.   }).after(‘ <img src=”/images/external.png” alt=”external link”>’);
  5. });

Post a Comment