Spyjax can scare you, or excite you depending on what you want to do.

By using a simple JavaScript check on the CSS style on URLs, a script can work out if you have been there:

JAVASCRIPT:

  1.  
  2. function hasLinkBeenVisited(url) {
  3.         var link = document.createElement(’a');
  4.         link.href = url;
  5.         document.body.appendChild(link);
  6.         if (link.currentStyle) {
  7.                 var color = link.currentStyle.color;
  8.                 if (color == ‘#ff0000′)
  9.                         return true;
  10.                 return false;
  11.         } else {
  12.                 link.setAttribute(”href”,url);
  13.                 var computed_style = document.defaultView.getComputedStyle( link, null );
  14.                 if (computed_style) {
  15.                         if (computed_style.color == ‘rgb(255, 0, 0)’)
  16.                                 return true;
  17.                 }
  18.                 return false;
  19.         }
  20. }
  21.  

Couple this with the ability to chunk this over time, and you could quickly test a lot of URLs.

Spyjax

Source: Ajaxian
Original Article: http://ajaxian.com/archives/spyjax-using-avisited-to-test-your-history

Leave a Reply

You must be logged in to post a comment.



Site Navigation

Warning: gmmktime() expects parameter 3 to be long, string given in /home/tipsclub/public_html/ajaxgirl/wp-content/plugins/wp-autoblog/rss_utils.inc on line 35

Warning: gmmktime() expects parameter 3 to be long, string given in /home/tipsclub/public_html/ajaxgirl/wp-content/plugins/wp-autoblog/rss_utils.inc on line 35

Warning: gmmktime() expects parameter 3 to be long, string given in /home/tipsclub/public_html/ajaxgirl/wp-content/plugins/wp-autoblog/rss_utils.inc on line 35

Warning: gmmktime() expects parameter 3 to be long, string given in /home/tipsclub/public_html/ajaxgirl/wp-content/plugins/wp-autoblog/rss_utils.inc on line 35

Warning: gmmktime() expects parameter 3 to be long, string given in /home/tipsclub/public_html/ajaxgirl/wp-content/plugins/wp-autoblog/rss_utils.inc on line 35

Warning: gmmktime() expects parameter 3 to be long, string given in /home/tipsclub/public_html/ajaxgirl/wp-content/plugins/wp-autoblog/rss_utils.inc on line 35

Warning: gmmktime() expects parameter 3 to be long, string given in /home/tipsclub/public_html/ajaxgirl/wp-content/plugins/wp-autoblog/rss_utils.inc on line 35

Warning: gmmktime() expects parameter 3 to be long, string given in /home/tipsclub/public_html/ajaxgirl/wp-content/plugins/wp-autoblog/rss_utils.inc on line 35

Warning: gmmktime() expects parameter 3 to be long, string given in /home/tipsclub/public_html/ajaxgirl/wp-content/plugins/wp-autoblog/rss_utils.inc on line 35

Warning: gmmktime() expects parameter 3 to be long, string given in /home/tipsclub/public_html/ajaxgirl/wp-content/plugins/wp-autoblog/rss_utils.inc on line 35