change url string without reloading page

C

chadsmith76

Is there a way to access a string in the url with ajax and change a
variable but not reload the page.

I know you can do this for id's

document.getElementById("page").value = page;

but I want to change the page value in the url as well. Here is what i
am trying to do (maybe there is another way and I am going about it all
wrong) I use ajax to do some paging but if someone wanted to book mark
a page if would get the right page. I have it set up so if you dont
have javascript and click to the next page it really takes you there,
url and all. If you do have javascript it uses ajax to load the next
page, but the url stays at the first loaded page.

If i can change the page var in the url each time with javascript then
the bookmarking should work.

Any ideas???

Thanks for any help.

chad
 
M

Matt Kruse

Is there a way to access a string in the url with ajax and change a
variable but not reload the page.

No, thankfully.
I have it set up so if you
dont have javascript and click to the next page it really takes you
there, url and all. If you do have javascript it uses ajax to load
the next page, but the url stays at the first loaded page.

Bookmarking is a usability problem introduced by Ajax.
You can provide a link to a "permanent url for this page" which users can
then bookmark.
Or, if your users want to bookmark pages at random and see the page exactly
as they are looking at it, don't use ajax to update content.
 
C

chadsmith76

Hey Matt,

Thanks for the fast reply. Yeah I have seen some of the browser history
issues, the direct link may be the best as the page has maps and more
info I don't want to reload each time. I thought maybe I caould change
the url variable to at least help with bookmarking. Oh well. I will now
tackle the history issue. (I have seen some ways to make it work, do
you know if they are just ugly hacks or are they real world standards?)
Thanks for the pointers

Chad
 

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

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top