Change URL without actually changing?


#1

Is it possible to change the URL in the browser window without actually
going there? I know I’ve seen flash apps do this. Yahoo maps is an
example.

Thanks for your help.


#2

This is called AJAX.

Ruby on Rails has excellent support for it.

http://api.rubyonrails.org/classes/ActionView/Helpers/PrototypeHelper.html

On Apr 18, 7:52 pm, Ben J. removed_email_address@domain.invalid


#3

Daniel F. wrote:

This is called AJAX.

Ruby on Rails has excellent support for it.

http://api.rubyonrails.org/classes/ActionView/Helpers/PrototypeHelper.html

On Apr 18, 7:52 pm, Ben J. removed_email_address@domain.invalid

Right, I want to basically add a feature to AJAX. When I change content
on my page I would like to change the URL in the browser window so users
can bookmark it. Is this possible? This way I get the benefits of URLs
without having to reload the page.


#4

On 4/18/07, Ben J. removed_email_address@domain.invalid wrote:

Right, I want to basically add a feature to AJAX. When I change content
on my page I would like to change the URL in the browser window so users
can bookmark it. Is this possible? This way I get the benefits of URLs
without having to reload the page.

You want to use window.location. Its not strictly ajax, its just
javascript.

here ya go:

http://www.google.com/search?q=window.location+changing+url

  • rob


http://robsanheim.com


#5

On 19 Apr 2007, at 06:35, Rob S. wrote:

On Apr 18, 7:52 pm, Ben J. removed_email_address@domain.invalid
javascript.

here ya go:

http://www.google.com/search?q=window.location+changing+url

Wouldn’t that trigger a reload of the page? You could have a look at
StateManager from the exanimo site, it’s the only AJAX state manager
I’ve found to work quite reliably on all browsers (including Safari).

Best regards

Peter De Berdt


#6

Here’s a link explaining how to change the URL without refreshing the
page (for instance to allow the back button to be used with ajax)

http://www.contentwithstyle.co.uk/Articles/38/fixing-the-back-button-
and-enabling-bookmarking-for-ajax-apps


#7

On 4/19/07, Peter De Berdt removed_email_address@domain.invalid wrote:

Ruby on Rails has excellent support for it.
removed_email_address@domain.invalid
without having to reload the page.
here ya go:

Best regards

Peter De Berdt

No, not if you just modify the hash (aka fragment identifier - the
piece after the ‘#’).

see: http://ajaxpatterns.org/Unique_URLs#Solution

  • Rob


http://robsanheim.com