Detect the sites your visitors use
Monday, April 6, 2009 8:27:09 PM
Download:
visited.js
Description:
Pass url to check is it was visited ("http://" part can be ommited).
Url can be with "https://", "ftp://" or any other protocols.
If url not visited i'll try to check with and without "www.".
Bunch of urls can be checked, pass them as array.
In return, keys is domains (without "http:", "www." and path).
Only one key per domain was returned.
Examples:
1. Check is "twitter.com/home" was visited by user.
2. Check bunch of urls and return per domain visited.
3. Check bunch of urls and return true or false for all of them.
visited.js
Description:
Pass url to check is it was visited ("http://" part can be ommited).
Url can be with "https://", "ftp://" or any other protocols.
If url not visited i'll try to check with and without "www.".
Bunch of urls can be checked, pass them as array.
In return, keys is domains (without "http:", "www." and path).
Only one key per domain was returned.
Examples:
1. Check is "twitter.com/home" was visited by user.
if ( visited('twitter.com/home') ) alert('yes');
2. Check bunch of urls and return per domain visited.
var v = visited(['twitter.com/home',
'www.facebook.com/home.php',
'www.facebook.com']);
if ( v['facebook.com'] && v['twitter.com'] ) alert('visited both');
3. Check bunch of urls and return true or false for all of them.
if (visited('twitter.com/home', 'www.facebook.com/home.php')) alert('both');














