problem with anchor events, please help!!

E

elibol

Hi,

Is there an event that fires when the back or forward button on a
browser is pressed? I need an event to fire when someone clicks the
back or forward button after an anchor has been set.

Thanks so much for reading about my problem!

H
 
L

Lee

(e-mail address removed) said:
Hi,

Is there an event that fires when the back or forward button on a
browser is pressed? I need an event to fire when someone clicks the
back or forward button after an anchor has been set.

What do you mean by "after an anchor has been set"?
 
E

elibol

Hi Lee,

I mean that when the url hash changes, or in other words, when the hash
property of the location object changes; more specifically, triggered
from either the forward or back button.

I will elaborate from a user perspective:

You enter a page with anchors, and the hyperlinks to the anchors are at
the top of the page. When you click on the hyperlink, it jumps to the
corresponding anchor, and the anchor hash appears in your address bar
(ie #description). Now, when you click on a few anchor links you begin
to build a history. Using your browser, when you click the back button,
you will begin jumping around the various named anchors you visited
previously.

And so, my question is whether there is a way to trigger a function
when the back and forward buttons are used to navigate between the
named anchors.

I appreciate your attention Lee,

H
 
R

Randy Webb

(e-mail address removed) said the following on 12/30/2005 7:45 PM:

Please quote what you are replying to.

If you want to post a followup via groups.google.com, don't use the
"Reply" link at the bottom of the article. Click on "show options" at
the top of the article, then click on the "Reply" at the bottom of the
article headers.

And so, my question is whether there is a way to trigger a function
when the back and forward buttons are used to navigate between the
named anchors.

You have no way of programatically knowing whether I clicked the
forward/back buttons or not. Nor will you know if I right clicked and
chose "Forward/Backward".

You can only, minimally, know that I am navigating. Not where I went,
where I came from, nor how I choose to get there.

You could try setting a cookie that tracked the history of the page. But
the approach and idea itself lends to failure.
 
E

elibol

Hi Randy,

I apologize for the mistake when replying, are there consequences to
the way I replied?

Well, let me describe the specific task that I'm trying to accomplish,
maybe you, or others, could lend some clarity to the limits I'm up
against.

I'm building a tool that will allow actionscript developers to use the
browsers forward and back button to trigger events by using the url
hash as the distinguishing identifier. Using the hash will also allow
for bookmarking, so that when a flash page is revisited, or linked, the
actual content that the end user is attempting to share may be directly
visited.

I have this working: http://www.anticipatechange.com/browserSupport/

use the setAnchor button to set the url hash, then use the back and
forward button to observe the functionality I'm talking about.

My problem is that the back and forward events are triggered by a
setInterval function from within flash that is continually checking the
url hash for differences, and so, when a difference is detected it
triggers an event.

I was hoping there was a way for me to trigger a function call when the
url hash changes, but if that's not possible, given the problem, can
you, or anyone else for that matter, think of a solution to this
problem?

I don't like the idea of having to continually check the url, it is a
terrible work around.

Thanks so much for your attention Randy,

H
 
E

elibol

Hi Jason,

Thanks you so much for your insight into the matter, you've helped me
alot. You've mentioned that onPropertyChange doesn't work with
location.hash, so I will rule that out as a possibility, however, the
code solution you've written is something I'm very interested in
implementing; would you recommend my using the onInterval function in
building a framework that is demanding of a high level in
compatibility?

The solution you've presented is better than the one I'm currently
using, since no document to object communication will be made, meaning,
I can use true delegation patterns, and in affect is the elimination of
the frequent cross scope communication. As I've said though, every new
javascript member I introduce into the framework must be multi agent
friendly.

I appreciate your attention Jasen,

H
 
E

elibol

Hi Jason,

Thank you so much for your insight into the matter, you've helped me
alot. You've mentioned that onPropertyChange doesn't work with
location.hash, so I will rule that out as a possibility, however, the
code solution you've written is something I'm very interested in
implementing; would you recommend my using the onInterval function in
building a framework that is demanding of a high level in
compatibility?

The solution you've presented is better than the one I'm currently
using, since no document to object communication will be made, meaning,
I can use true delegation patterns, and in affect is the elimination of
the frequent cross scope communication. As I've said though, every new
javascript member I introduce into the framework must be multi agent
friendly.

I appreciate your attention Jasen,

H
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top