Forum Moderators: open

Message Too Old, No Replies

Modifying displayed URL - no reload

         

Readie

5:26 pm on Apr 21, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Right, as this is a bit of an odd one I'll give some background information:

We have a system whereby a user clicks links, and it activates some jQuery to change the contents of a div, whilest using return false; to supress the href. For non-JS users, we use PHP $_GET to accomplish the same thing (the links return true).

However, we want JS users to be able to perma-link to the page with the link they clicked (so the PHP $_GET is provided) without either a box somewhere on the page with a URL in, or reloading the page.

So, my question: is it possible to change the displayed URL and not reload the page? And if so, how would I go about doing it?

Fotiman

6:07 pm on Apr 21, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



No, it is not possible. That would present a security risk (giving people the impression that they are visiting one page when in fact they are not).

Readie

6:12 pm on Apr 21, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I suspected as much.

Dissapointing all the same though. Thanks for replying :)

whoisgregg

8:04 pm on Apr 21, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It would be possible to alter the value after the hash tag (#) without reloading the entire page. AJAX driven websites (Facebook being a good example of this) do this on a regular basis. Users can then copy and paste the entire URL in their address bar and share that with other people.

The links aren't "real" to search engines though, unless you use the new "#!" format proposed by Google [googlewebmastercentral.blogspot.com] to make AJAX sites crawlable.