Connecting Tech Pros Worldwide Help | Site Map

Change the browser URL without navigating away?

Paul Neave
Guest
 
Posts: n/a
#1: Nov 3 '05
Yahoo! has launched a beta of it's new mapping application:

http://maps.yahoo.com/beta/

It's based in Flash, but it uses JavaScript. I'm curious about one
feature, though - when you pan about the map, the URL in the address
bar of your browser changes to match your current location. How have
they done this? I thought calling window.location.href = "etc"; would
reload the page, navigating away from the current URL. Yahoo! have
managed to do this without the page changing. This is a very useful
technique for DHTML/AJAX/Flash technology and I'd love to know how
they've done it.

Many thanks,
Paul.

VK
Guest
 
Posts: n/a
#2: Nov 3 '05

re: Change the browser URL without navigating away?



Paul Neave wrote:[color=blue]
> Yahoo! has launched a beta of it's new mapping application:
>
> http://maps.yahoo.com/beta/
>
> It's based in Flash, but it uses JavaScript. I'm curious about one
> feature, though - when you pan about the map, the URL in the address
> bar of your browser changes to match your current location. How have
> they done this? I thought calling window.location.href = "etc"; would
> reload the page, navigating away from the current URL. Yahoo! have
> managed to do this without the page changing. This is a very useful
> technique for DHTML/AJAX/Flash technology and I'd love to know how
> they've done it.
>
> Many thanks,
> Paul.[/color]

An example of non-parallel thinking, combined with 3W recommendations
sent to the hell.
Link hash part (anchor name) #blah-blah-blah does not lead to
navigation away from the current page. Unresolved anchor names do not
lead anymore neither to a page shift not to an error: tested on IE 6.0
and FF 1.0.7
Opera 8.1 fails on it (did not check yet Opera 8.5, cannot check Safari
and Konqueror)

document.location.hash = "Write all what you need";

Ingenious! Another exellent example to myself to read less about
standards or rely on some previous experience. Only continues
experiments on concrete systems have practical value.

Zwerfkat
Guest
 
Posts: n/a
#3: Nov 3 '05

re: Change the browser URL without navigating away?


"Paul Neave" <paul.neave@gmail.com> wrote in message
news:1131014890.465631.139740@o13g2000cwo.googlegr oups.com...[color=blue]
> Yahoo! has launched a beta of it's new mapping application:
>
> http://maps.yahoo.com/beta/
>
> It's based in Flash, but it uses JavaScript. I'm curious about one
> feature, though - when you pan about the map, the URL in the address
> bar of your browser changes to match your current location. How have
> they done this? I thought calling window.location.href = "etc"; would
> reload the page, navigating away from the current URL. Yahoo! have
> managed to do this without the page changing. This is a very useful
> technique for DHTML/AJAX/Flash technology and I'd love to know how
> they've done it.
>
> Many thanks,
> Paul.[/color]

Only the hash part of the url is changing. You can do this as follows:

parent.location.hash = 'hello';

The actual URL http://maps.yahoo.com/beta/ before the '#' cannot be changed without a page reload.




Paul Neave
Guest
 
Posts: n/a
#4: Nov 3 '05

re: Change the browser URL without navigating away?


Thanks guys - for those interested, here are some workarounds that use
this method for bookmarking and using the back button in Flash:

http://www.quasimondo.com/archives/000570.php

http://www.unfocus.com/Projects/FlashSuite/

http://www.chakramedia.com/deeplink-...ton/index.html

Closed Thread


Similar JavaScript / Ajax / DHTML bytes