Created
April 14, 2010 21:38
-
-
Save scottwb/366373 to your computer and use it in GitHub Desktop.
JS to detect if the user has been to certain URLs.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%div#whereyoubeen{:style => "display:none"} | |
%a{:href => "http://www.google.com/"} Google | |
%a{:href => "http://www.amazon.com/"} Amazon | |
%a{:href => "http://www.yahoo.com/"} Yahoo | |
%a{:href => "http://www.neimanmarcus.com/"} Neiman Marcus | |
%a{:href => "http://www.strings.com/"} Strings | |
%a{:href => "http://www.huffingtonpost.com/"} Huffington Post | |
:javascript | |
alert("You have been to: " + $$('#whereyoubeen a:visited').map(function(link) {return link.innerHTML;}).join(',')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment