0

Checkout http://mobile.twitter.com

When clicking a link, semms like page loading with javascript, not with browser. How can i do that?

  • There's a lot of these questions: http://stackoverflow.com/questions/1934706/how-to-update-a-web-page-without-reloading-the-web-page-using-ajax http://stackoverflow.com/questions/28125226/how-to-update-content-automatically-without-reloading-webpage-using-php-ajax – PaulBGD Feb 12 '17 at 19:59
  • Possible duplicate of [How to update a web page without reloading the web page using AJAX?](http://stackoverflow.com/questions/1934706/how-to-update-a-web-page-without-reloading-the-web-page-using-ajax) – PaulBGD Feb 12 '17 at 19:59

1 Answers1

0

What you are looking for is called pushState according to the documentation (http://ud.ht/SgZm). This technology is available only for browsers supporting HTML5 and it is vastly used in many websites. If you want to feel the difference, open Facebook with a new and an old browser and you will see that instead of changing the url in an old browser, Facebook does change the hash value.

This is an example of how it works:

if (typeof(history.pushState)=='function'){
    history.pushState(stateObj, "page 2", "bar.html");
}

Remember, you need to run it when you successfully load a page completely and don't forget to write an event listener for the browser back button.

Amir H. Bagheri
  • 1,416
  • 1
  • 9
  • 17