HTML and CSS Reference
In-Depth Information
* method, which is defined below passing in the
* HTML as a string from the card.
*/
setCardContent(card);
/**
* Finally, you rebind all of the links, so that
* any new content links are bound to
* XMLHttpRequest calls.
*/
bindLinks();
} else {
/**
* If the request fails, you simply set the
* contents of the div to show an error message.
*/
setCardContent('<div id="card"><h1>Oops</h1><p>Something went
wrong!</p></div>');
}
}
}
/**
* Finally, send the request. As the request's state changes, the
* callback method will be called.
*/
xhr.send();
}
/**
* This will set the content of the container to be the card from the
requested
* HTML file. POSH is simply an acronym for Plain Old Semantic HTML.
*/
function setCardContent(posh){
container.innerHTML = posh;
}
/**
* Finally, you call bindLinks(), which will bind the links currently
displayed
* on the page.
*/
bindLinks();
/**
Search WWH ::




Custom Search