javascript set location without redirect

C

cforcloud karulvan

hi all,

i am working on a ajax calendar program, where the user will click on
a date and its corresponding event list will be displayed beside it
(similar to http://www.google.com/calendar). there are day & week
views, the event list is picked from a database and the page will
never refresh anytime. am done up to this point!

i would like to add a feature, where permanent links can be set for a
day's event list. like when the user clicks on a date, a permanent
link is put on the location/address bar, which he can copy and sent it
to others.

yeah, just like http://wikimapia.org (not like http://maps.google.com/)...
where we scroll the map - the url in address bar automatically changes
to the permanent link... lcheck this place 'Who planted this and
why?' (http://wikimapia.org/
#lat=1.847196&lon=-157.473527&z=18&l=0&m=a&v=2) ...

well i know to pickup the parameters from the address bar
(window.location.search) and display the event list, but how to set
this string without refreshing the page.
so the user clicks on 23rd Oct, 2007 in the calendar and the address
bar must read
ajax_calendar.htm?date=20071023

many thanks for any kind of help!
please let me know if am not clear enough

thaankqquu - cforcloud
 
D

David Golightly

hi all,

i am working on a ajax calendar program, where the user will click on
a date and its corresponding event list will be displayed beside it
(similar tohttp://www.google.com/calendar). there are day & week
views, the event list is picked from a database and the page will
never refresh anytime. am done up to this point!

i would like to add a feature, where permanent links can be set for a
day's event list. like when the user clicks on a date, a permanent
link is put on the location/address bar, which he can copy and sent it
to others.

yeah, just likehttp://wikimapia.org(not likehttp://maps.google.com/)...
where we scroll the map - the url in address bar automatically changes
to the permanent link... lcheck this place 'Who planted this and
why?' (http://wikimapia.org/
#lat=1.847196&lon=-157.473527&z=18&l=0&m=a&v=2) ...

well i know to pickup the parameters from the address bar
(window.location.search) and display the event list, but how to set
this string without refreshing the page.
so the user clicks on 23rd Oct, 2007 in the calendar and the address
bar must read
ajax_calendar.htm?date=20071023

many thanks for any kind of help!
please let me know if am not clear enough

thaankqquu - cforcloud

Use window.location.hash. It's the stuff in the URL following the "#"
sign. Originally used for named anchor tags on a page (you know, <A
NAME="top">top</a> blah blah blah <A HREF="#top">To top</A> from the
days of yore), it's emerged as the only way to track page state in the
URL. Browser history managers such as Really Simple History and YAHOO
UI History Manager use it to simulate back-button functionality on
Ajax-heavy pages; their (open-source) codebases might give you some
ideas. Note however that the location hash is not sent to the server,
so don't rely on your server-side code being able to do any work on it
for you.

-David
 
D

David Mark

Use window.location.hash. It's the stuff in the URL following the "#"
sign. Originally used for named anchor tags on a page (you know, <A
NAME="top">top</a> blah blah blah <A HREF="#top">To top</A> from the
days of yore), it's emerged as the only way to track page state in the

Bookmark navigation is its purpose. That hasn't changed.
URL. Browser history managers such as Really Simple History and YAHOO
UI History Manager use it to simulate back-button functionality on
Ajax-heavy pages; their (open-source) codebases might give you some

It should be noted that this practice is completely insane. Web apps
need to implement their own navigation interface.
 
D

David Golightly

Bookmark navigation is its purpose. That hasn't changed.


It should be noted that this practice is completely insane. Web apps
need to implement their own navigation interface.

What alternatives are there, and how do they work, exactly, without
"breaking the back button"?
 

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,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top