Adam Moore
Web Developer
with JavaScript and jQuery
basically means that this process goes on without blocking any other actions. You can still scroll through the page and load other assets while your Ajax data is being loaded.
{
{
Yes...
{
although you can get XML most of the time you’ll be pulling JSON back from an API
It pulls information behind the scenes without a page refresh. - like Twitter, Google Maps, and even DT Responsive Websites.
Quickly see it in action using the console in
Chrome - (Log XMLHttpRequests)
var xhr = new XMLHttpRequest();
xhr.open('GET', 'sidebar.html');
xhr.onreadystatechange = function () {
if (xhr.readyState === 4) {
document.getElementById('ajax')
.innerHTML = xhr.responseText;
}
};
xhr.send();
The jQuery library has a full suite of Ajax capabilities. The functions and methods therein allow us to load data from the server without a browser page refresh.
$.get( "sidebar.html", function( data ) {
$( "#ajax" ).html( data );
});
http://api.jquery.com/category/ajax/
By Adam Moore