Loading External Content

Submitted by:Andery Smith

Date added:11 April, 2013

Category:jQuery

Pull external HTML code from a file right into your webpage

Tags: loading content

Code Snippet:

$("#content").load("somefile.html", function(response, status, xhr) {
// error handling
if(status == "error") {
$("#content").html("An error occured: " + xhr.status + " " + xhr.statusText);
}
});
 
 

Comments