Welcome Guest, Not a member yet? Register   Sign In
Facebook-style navigation url changer ?
#1

[eluser]yannyannyann[/eluser]
I started the discussion here at the end of antoher topic :
http://ellislab.com/forums/viewthread/109619/#552707

But I prefer talking more clearly here :

How can change the URL in the address bar, whithout reloading the page ?

My jQuery ajax method is already retrieving a JSON object from the Database so I can change my picture, title, and so on in the page...

BUT ! I would like to change the URL as well, like in Facebook, when you go through the picture, the URL changes.
#2

[eluser]jedd[/eluser]
Quote:How can change the URL in the address bar, whithout reloading the page ?

I really don't see how you can. Any browser that allowed that would be an insecure browser, to my mind. The opportunities for evil would be quite sizeable.

Hmmm .. perhaps it's a feature in IE8.

And as embarrassing as it is to admit to having one, I just tried using my FB account to look at pictures, and it seems to do a page reload to go from thumbs to full-size (well, what they call a full-size) image.
#3

[eluser]drewbee[/eluser]
You can, its called trickeration!

The only thing facebook changes in that url in after the anchor (#blah). This can be changed without reloading the page as it is used to actually link within documents. PHP can read this on the intial page load, as well as a use it for any ajax calls you need to make.

You cannot change anything before the # though. So if you needed to load a specific page, you would do this:

myfile.php#file_to_load

This actively changes on every click of an anchor tag Smile
#4

[eluser]jwindhorst[/eluser]
Is this what you are looking for?

Code:
[removed].href='#junkIwantInTheUrl';

HAH, they won't let me who you in here! LOL too funny!

Lets take a different approach, the JS way, likley would refresh on you.

Code:
<a href="/#junkInUrl">Junk I see.</a>

That should do it since you are actually linking to an ID on the same page. Don't forget though, if that ID does exist on the page, you may scroll yourself to it.




Theme © iAndrew 2016 - Forum software by © MyBB