December 2013
Intermediate to advanced
384 pages
9h 54m
English
$("#content").load("new.html");
A great way to add dynamic data to a web page is to have the web server deliver the data already formatted as HTML. Then, using the jQuery .load() AJAX method, you can load the data directly into an element.
The .load() AJAX method can be called from any jQuery object and performs an AJAX get request in the background, formats the response, and injects it as the innerHTML of the element. For example:
$("#content").load("new.html");
The following code shows an example of using the .load() method to load lorem ipsum article data from the web server into an existing <div> container. Figure 13.4 illustrates loading ...
Read now
Unlock full access