469,315 Members | 1,592 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,315 developers. It's quick & easy.

Event on anchor change(click back button) in URL

Hi

We are developing an Ajax based application. In this application the
URL is fixed and as user navigates on the application we will change
Anchor on the URL so that user can bookmark the url and can load the
page on demand.

When user refreshes the page we have no issue in the populating the
page based on the anchor in URL as on load we can capture the
hash(#anchor) and act accordingly.

sample URL: http://www.google.com/somecontext#<anchor>

When the user clicks back button anchor is changing but not able to
know where to get callback.
Is there any event or way I can find when the user has clicked back
button.

Any help is appreciated. Thanks in advance.

Thanks
Venkat Gunnu

Jul 26 '07 #1
2 5919
On Jul 26, 1:41 pm, gvrajku...@gmail.com wrote:
Hi

We are developing an Ajax based application. In this application the
URL is fixed and as user navigates on the application we will change
Anchor on the URL so that user can bookmark the url and can load the
page on demand.

When user refreshes the page we have no issue in the populating the
page based on the anchor in URL as on load we can capture the
hash(#anchor) and act accordingly.

sample URL:http://www.google.com/somecontext#<anchor>

When the user clicks back button anchor is changing but not able to
know where to get callback.
Is there any event or way I can find when the user has clicked back
button.

Any help is appreciated. Thanks in advance.

Thanks
Venkat Gunnu
No, you can't do that. It's been talked about a lot on various
Internet sites lately, since Ajax became popular. What you CAN do, and
what people usually do, is set an interval do check the value of
location.href every 200 ms or similar, and when the user clicks back
the monitor (the object that checks the value of href) will notice
that soon and act accordingly. It works just fine.

Jul 26 '07 #2
On Jul 26, 10:47 am, Darko <darko.maksimo...@gmail.comwrote:
On Jul 26, 1:41 pm, gvrajku...@gmail.com wrote:


Hi
We are developing an Ajax based application. In this application the
URL is fixed and as user navigates on the application we will change
Anchor on the URL so that user can bookmark the url and can load the
page on demand.
When user refreshes the page we have no issue in the populating the
page based on the anchor in URL as on load we can capture the
hash(#anchor) and act accordingly.
sample URL:http://www.google.com/somecontext#<anchor>
When the user clicks back button anchor is changing but not able to
know where to get callback.
Is there any event or way I can find when the user has clicked back
button.
Any help is appreciated. Thanks in advance.
Thanks
Venkat Gunnu

No, you can't do that. It's been talked about a lot on various
Internet sites lately, since Ajax became popular. What you CAN do, and
what people usually do, is set an interval do check the value of
location.href every 200 ms or similar, and when the user clicks back
This sounds crazy to me. Why try to make the browser interface do
something it wasn't designed to do? If you are going to write a Web
application that runs on a single page, you need to provide a suitable
navigation interface. By the same token, you can provide a
bookmarking interface that tacks on a hash without polluting the
browser's navigation history.

Jul 26 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Ersin Gençtürk | last post: by
3 posts views Thread by Paul | last post: by
1 post views Thread by confusedofphp | last post: by
8 posts views Thread by Harvey Schmidlapp | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.