21

I just discovered pjax and I find it completly awesome. If I understand it correctly, it's AJAX, but without its problems (fully degradable, the URL and the title of the page is changing when using it, compatible with search bots...).

But I am very curious as how it's working ? How can we change the URL in the browser, without the page to change... I read somewhere you need Firefox 4, is that a new "web" feature then ?

Matthieu Napoli
  • 42,736
  • 37
  • 154
  • 239

1 Answers1

32

It's just a wrapper around "$.ajax()". It uses the new "pushState" and "replaceState" methods to manipulate the history.

Also see this SO question too, and notably the link to History.js.

edit — note that by writing "just a wrapper" I do not mean to belittle the pjax plugin. I simply meant that it's not some radical new functionality; it's still XMLHttpRequest under the covers.

Community
  • 1
  • 1
Pointy
  • 371,531
  • 55
  • 528
  • 584