Tuesday, January 24th, 2006

Automatic external link interstitials using JavaScript and Behavior.js

Category: Examples, JavaScript

Do you work in an industry that needs to be paranoid about privacy?

Patrick Fitzgerald works at WebMD, and had to make sure that users were warned when going to external areas.

You could go through every a href, but that is error prone, and isn’t safe.

In the Aspect world this would be a called a cross-cutting concern. You want to be able to declare in one place “all external links need to first filter through X”.

Patrick did just this using good old Behaviour.js as the implementation.

Posted by Dion Almaer at 3:05 am

3.8 rating from 24 votes


Comments feed TrackBack URI

An interesting idea, but it failed for me as I have pop-ups blocked – therefore, I am not notified of the different policy, etc. If WebMD is doing this to try to shield themselves from potential liability, I would argue this isn’t very effective given the popularity of pop-up blockers.

I’d suggest an inline DIV as a pop-up substitute which holds the disclaimer/warning content, along with a regular link (or button) sans event handlers to the external site – similar perhaps to the inline image viewing script covered on here recently.

Comment by Scott Schiller — January 24, 2006

And if javascript is disabled?

Comment by sup — January 24, 2006

[…] Inspired by Automatic external link interstitials using JavaScript and Behavior.js (via Ajaxian), I decided to try to implement the same idea using Yahoo! User Interface Library. (No, I don’t have new ideas, just sample code… read on!) Here’s the meat of the code: […]

Pingback by Cultivate, Battle, Learn » Blog Archive » Outbound Link Warnings with YUL — March 19, 2006

Leave a comment

You must be logged in to post a comment.