On my site, I would like to load an AJAX page, as shown on Facebook, Twitter and the relatively small Kotaku Gaming site.
Basically, this is what I want to do: a header that remains static on all pages in the domain and only loads content into a specific container using AJAX and jQuery.
jQuery $. load () is almost perfect, but only almost. This is basically the code I would use:
$("#content").load("site.html");
However, when another page is "loaded" with this function, the URL does not change. This will lead to the destruction of bookmarks, as well as to binding, and therefore unacceptable. URL must be changed.
Problem with $. get () is that the title changes along with the rest of the page, which of course is not what I'm looking for.
Can someone help me with this? If the sites mentioned above can do this, why can't I?
source share