Javascript history does not work -


document.addeventlistener('domcontentloaded', function () {   displayrecenturls("recenturls"); });  function displayrecenturls(divname) {     var popup = document.getelementbyid(divname);     var ul = document.createelement("ul");     popup.appendchild(ul);     var microsecondsperweek = 1000 * 60 * 60 * 24 * 7;     var oneweekago = (new date).gettime() - microsecondsperweek;     history.search({       'text': '',                     'starttime': oneweekago       },     function(historyitems) {       (var = 0; < historyitems.length; ++i) {         var url = historyitems[i].url;         var li = document.createelement("li");         ul.appendchild(li);         var = document.createelement("a");         a.href = url;         a.appendchild(document.createtextnode(url));         li.appendchild(a);       }      }); } 

i wrote code above generate browsing history 1 week. not work. i'm new javascript may have made silly mistake.

as far know cannot browser history. can however, see if user has visited urls or not. here's example.

if want go 1 page back, document.referrer gives page user came from.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -