wilsonpage
wilsonpage

Reputation: 17600

Ajax navigation without #!

I have noticed that sites like http://hypem.com which is a full ajax site have now managed to scrap their #! ajax urls but maintained a full ajax site. How is this possible?

Upvotes: 9

Views: 1639

Answers (4)

Yogesh Agrawal
Yogesh Agrawal

Reputation: 982

HTML5 has new History API. Demo is available at this url. http://html5demos.com/history/

https://github.com/browserstate/history.js has a very good support for this. Also history.js is plug able with jquery, mootools etc and supports HTML4 browsers too.

Upvotes: 0

bastien
bastien

Reputation: 131

simply include your

<script type="text/javascript" src="https://raw.github.com/binarymind/jquery-navigate/master/navigate.js" ></script>

and

<script type="text/javascript"
$(document).ready(function() {
    $.navigate.init();
});
</script>

after the include to jquery (1.7+) in the <head> and the plugin will ajax-navigate automaticaly in your website.

for any more customization, doc or answers you can go on github https://github.com/binarymind/jquery-navigate

hope it helps.

bastien

Upvotes: 0

alex
alex

Reputation: 490403

Some modern browsers support history.pushState().

However, if you want to support older browsers that are still popular, you should use the hash fallback.

Upvotes: 5

fijter
fijter

Reputation: 18057

You can do this with history.pushState, only in decent browsers though ;)

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

Here's a jQuery plugin with a fallback for older browsers to a hashed URL: http://plugins.jquery.com/project/history-js

Upvotes: 5

Related Questions