Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Feb 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Modify url with no refresh

    Ok i'm trying to do some url manipulation without refresh. i've read a bunch of articles and everything i read says i have to use parent.location.hash. i don't want this because i don't want to use an anchored navigation. i also don't want the # sign to show up at all. let me explain what i want to accomplish.

    let's say your at mysite.com. i want you to be able to click a link and it adds to the url without refreshing the page. i will then write some ajax that will listen for that change and do some functions that i desire. so if you're at mysite.com and you click on the about link, i want the url to read mysite.com/about, but without refreshing the page. i know this has to be possible because i've seen something very similar on actionmethod.com. if anyone has an action method account if you login and type anything in the search and pay attention to the url you will see exactly what i mean. and that's exactly what i want to do. in action method, for those who don't have it, the url will read, for example.

    actionmethod.com/Project=all/Filter=all

    when you login. and when you type something in the search. if you look at the url it will change to (ex. search is "Steps")

    actionmethod.com/Project=all/Search=Steps/Filter=all

    the page never refreshes and an ajax is called to perform the search and display it in the middle of the page for you.

    i am trying to do the exact same thing. i want to go to mysite.com. then if i click on about it will change the url to mysite.com WITH NO REFRESH and an ajax script will take care of the rest from there.

    any suggestions is absolutely welcome. i'm starting to learn jquery and i think it might be able to do what i want so if anyone has any ideas all are welcome


    p.s. if anyone knows how to simply remove the # that document.location.hash adds to the url this would work as well. i can do a work around for the anchored navigation. i just hate seeing the # on the url.

    so if anyone knows how to make this work,

    document.location.hash = "hello";

    go to mysite.com/hello instead of mysite.com/#hello

    that would perfect. i know this is something the browser adds but there must me some work around to it.


    THANK YOU IN ADVANCED FOR ANY POSTS TO THIS REPLY. I APPRECIATE ANYONE EVEN READING THROUGH THIS AND TAKING THE TIME TO ASSIST ME.
    Last edited by selanac82; 02-18-2009 at 05:48 PM. Reason: adding content

  • #2
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    You can only change the hash and you can not change the rest of the url without refreshing the page.

    So you either need to live with the hash or give the users a "link to the results" link on the page that they can click get your formatted url.

    Eric
    Tech Author [Ajax In Action, JavaScript: Visual Blueprint]


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •