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

2
  • 2
    pushstate. However, in IE<10, you'll have to use the hash or page reloads. Commented Jul 9, 2013 at 18:19
  • I answered in a similar question. Take a look this answer. stackoverflow.com/questions/13358020/… Commented Jul 6, 2015 at 19:17

2 Answers 2

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.

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

Comments

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.

Comments

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.