change url string without reloading page

Discussion in 'Javascript' started by chadsmith76@gmail.com, Jun 20, 2006.

  1. Guest

    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
     
    , Jun 20, 2006
    #1
    1. Advertising

  2. Matt Kruse Guest

    wrote:
    > 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.

    --
    Matt Kruse
    http://www.JavascriptToolbox.com
    http://www.AjaxToolbox.com
     
    Matt Kruse, Jun 20, 2006
    #2
    1. Advertising

  3. Guest

    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
     
    , Jun 20, 2006
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Urs Vogel
    Replies:
    2
    Views:
    2,447
    Urs Vogel
    Jun 10, 2004
  2. Richard
    Replies:
    3
    Views:
    568
    Richard
    Jul 22, 2004
  3. iwearwatches

    changing the URL without reloading the page

    iwearwatches, Sep 20, 2005, in forum: Javascript
    Replies:
    5
    Views:
    202
    iwearwatches
    Sep 21, 2005
  4. Tamer
    Replies:
    2
    Views:
    234
    António Marques
    Jan 21, 2008
  5. nick
    Replies:
    1
    Views:
    511
    David Mark
    Feb 13, 2011
Loading...

Share This Page