0

I need functionality like the below website. When you scroll down, new stories are fetched from server using AJAX and the URL is also updated. There is no hash # in url as well.

http://qz.com/

How can I achieve this?

thanks

Tepu
  • 1,262
  • 2
  • 16
  • 26
  • 2
    pushstate. However, in IE<10, you'll have to use the hash or page reloads. – Kevin B Jul 09 '13 at 18:19
  • I answered in a similar question. Take a look this answer. http://stackoverflow.com/questions/13358020/how-can-i-make-wordpress-infinite-scrolling-change-the-url/31243320#31243320 – wataru Jul 06 '15 at 19:17

2 Answers2

2
window.history.pushState(“state object/id”, “Title”, “/new-url”);

Still, you need to use hashes on browsers that do not support it. I use https://github.com/browserstate/history.js that does all the old browsers fallbacks for me.

Artek Wisniewski
  • 797
  • 4
  • 12
1

You might like to try project sarus.

http://srijanlabs.github.io/sarus/

It is a framework built in angularJS to carry out similar functionality. It fetches articles as the user scrolls through the page while url mapping is maintained in browser's address bar.

Moreover, being a frontend application it is highly customizable and works with API/RSS to fetch data.

fotuzlab
  • 1,396
  • 1
  • 14
  • 17