Home >Web Front-end >JS Tutorial >Detailed explanation of Ajax load method in jQuery_jquery

Detailed explanation of Ajax load method in jQuery_jquery

WBOY
WBOYOriginal
2016-05-16 16:20:191392browse

Let’s look at an Ajax example first

Copy code The code is as follows:













Contents of test.jsp:

Copy code The code is as follows:

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%out.println("Hello Ajax!");%>

Let’s take a look at Ajax in jQuery

1.load()

The load() method is the simplest and most commonly used Ajax method in jQuery, which can remotely load HTML code and insert it into the DOM.

Remote HTML code:

Copy code The code is as follows:









Zhang San:

Sofa.




李思:

Bench.




Wang Wu:

Floor.





load() loads HTML

Copy code The code is as follows:











Already commented





load() loads the filtered HTML document

Copy code The code is as follows:




   
   
   
   



已有评论





load()方法---回调函数

复制代码 代码如下:




   
   
   
   



已有评论





END

以上就是本文的全部内容了,希望对大家能有所帮助。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn