Connecting Tech Pros Worldwide Forums | Help | Site Map

Event on anchor change(click back button) in URL

gvrajkumar@gmail.com
Guest
 
Posts: n/a
#1: Jul 26 '07
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

Darko
Guest
 
Posts: n/a
#2: Jul 26 '07

re: Event on anchor change(click back button) in URL


On Jul 26, 1:41 pm, gvrajku...@gmail.com wrote:
Quote:
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.

David Mark
Guest
 
Posts: n/a
#3: Jul 26 '07

re: Event on anchor change(click back button) in URL


On Jul 26, 10:47 am, Darko <darko.maksimo...@gmail.comwrote:
Quote:
On Jul 26, 1:41 pm, gvrajku...@gmail.com wrote:
>
>
>
>
>
Quote:
Hi
>
Quote:
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.
>
Quote:
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.
>
Quote:
sample URL:http://www.google.com/somecontext#<anchor>
>
Quote:
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.
>
Quote:
Any help is appreciated. Thanks in advance.
>
Quote:
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.

Closed Thread