Link to home
Start Free TrialLog in
Avatar of ggray1970
ggray1970

asked on

help with history object

I am very new to javascript and have written a very simple code displaying the number of pages stored in the history object.  My problem is that no matter how many times I leave and return or refresh, the number stays at 1?  I need it to update automatically when I movbe to another page and then return.
<SCRIPT LANGUAGE="JavaScript">

document.write("Number of pages currently visited: " + history.length);

</SCRIPT>

Please help or direct me to where I may find the answer.
ASKER CERTIFIED SOLUTION
Avatar of OmniUnlimited
OmniUnlimited
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of leakim971
your code run fine
if you click to a link in your page and come back it, you don't add a new history
Avatar of ggray1970
ggray1970

ASKER

I was using the browser back buttons to return to the page.  When retyping the site in the address bar the count automatically updated.  I told you I was NEW to Javascript.  Thanks a lot man!
LOL.  No problem.  I'm happy to assist.