Can we catch the browser (IE) history count?

I am handling some frame based application.. where I can count / length the history details... I just want to alert/fire some message when the history raising from 10 to 11 th page..?

Probably I will be moving the pages..so i have the history details on my browser .. also i could get the history length ...

Is it possible to catch the history  and display some alert message ??

So How to catch the 11th history...? moving from 10th count/length
LVL 36
Loganathan NatarajanLAMP DeveloperAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Michel PlungjanIT ExpertCommented:
Keep track yourself

If you count history, you need to know when it was empty
So if you hae 100% control, you can do

<body onUnload="if (history.length==10) alert('Leaving the 10th page')">
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Loganathan NatarajanLAMP DeveloperAuthor Commented:
You are right mplungjan. But my issue is, I am handling page navigation with iframe. I am adding attribute to iframe like

frame1.Attributes.Add("onload", "javascript:alert(history.length);");

This executes only after the page is loaded completely. But Browser increments the history length well in advance. How to do that in my iframe page?

The real issue, if my page have more images, the above javascript is getting executed after all the images are loaded. But the browser is incrementing the history length before that. How?
0
Michel PlungjanIT ExpertCommented:
If you are handling it, count where you handle it.
What is the actual issue here. What are you trying to achieve?

Michel
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

Loganathan NatarajanLAMP DeveloperAuthor Commented:
when the history.length is being updated, i am able to get the length only after <iframe loaded completed ... Is it possible to get it before (i.e when the iframe page loads ...itself...

any idea?

(On the main page, I am loading the iframe and doing this work... trying to load different iframes on the main page...
0
Loganathan NatarajanLAMP DeveloperAuthor Commented:
any other comments?
0
Michel PlungjanIT ExpertCommented:
No. Sorry. I do not understand your issue.
If you have full control over what you load, then I do not see a need to look at the history object
0
Loganathan NatarajanLAMP DeveloperAuthor Commented:
Now, I have set it as Timer ... it is ok now... ok.. i will close this topic .. i got something to do.,
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.