JQuery Event-Load () method
The load () event occurs when the specified element (and child element) is loaded.
Instance
When the image is loaded, change the text of the DIV element:
$ ("img"). Load (function () {
$ ("div"). Text ("Image Loaded");
});
Append () method
The Append () method inserts the specified content at the end of the selected element (still inside).
Tip: The Append () and Appendto () methods perform the same tasks. The difference is: the location of the content and the selector.
Instance
Insert content at the end of each P element:
$ ("button"). Click (function () {
$ ("P"). Append ("<b>hello world!</b>");
});
Application examples
More Articles
var url= '/ajaxarchive.php?page=1 ';
$ ("#archivePlaceHold"). Load (URL);
Jquery.load () can only replace the contents of the element.
Jquery.load () cannot use append at the same time, you need to use Jquery.get () to implement
var url= '/ajaxarchive.php?page=1 ';
$.get (URL, function (data) {
$ (data). Appendto ("#archivePlaceHold");
});