0

I know that changing the URL is possible, but I thought it is only allowed for the part behind the hash tag. (I am using it for ajax loaded content.)

Now I have seen some website are changing even the URL after the domain on sites that are not using the hash tag. Is this possible in all browsers? I read once that such a capability is proposed in some future html/js specifications but is still not approved.

1 Answer 1

2

They're using the history API :

https://developer.mozilla.org/en/DOM/Manipulating_the_browser_history

That's common in ajax.

Beware that it's not really easy and painful to debug.

If you like, you can read the source of this one page site : http://dystroy.org/re7210/

Sign up to request clarification or add additional context in comments.

8 Comments

I wouldn't say it's difficult or painful to debug: there's certainly some fiddling required to get it working perfectly forwards and backwards, but in my experience the API is clean and easy to use.
When the state of your application is complex, with different screens and workflows and so on, it takes more work in my opinion than most ajax tasks. But that's just my opinion ;)
I am already using this through the jquery history plugin, that was not the questions. At the time I have implemented the ajax loading on our webpage only the changing of the part after the hash tag was possible. Now it seems that all after the domain name can be changed. Which browser are supporting this?
Ah yes, I see how you meant it now. I quite agree, for a complex application working out when and how to change the URL is a big job.
@petres : you can change the whole URL after the domain using the API defined in the link I provided. The only limit is this one : "The new URL must be of the same origin as the current URL".
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.