What does load mean in jquery?

藏色散人
Release: 2021-11-12 11:11:31
Original
2294 people have browsed it

The load method in jquery loads data from the server and places the returned data into the specified element. Its usage syntax is "$(selector).load(url,data,function(response,status,xhr) ))”.

What does load mean in jquery?

The operating environment of this article: windows7 system, jquery version 3.2.1, DELL G3 computer

What does load mean in jquery?

The jquery load() method loads data from the server and places the returned data into the specified element.

Note: There is also a jQuery event method called load. Which one is called depends on the parameters.

Syntax

$(selector).load(url,data,function(response,status,xhr))
Copy after login

Parameters

url required. Specify the URL you need to load.

data Optional. Specifies the data to be sent to the server with the request.

function(response,status,xhr) Optional. Specifies the callback function to be run when the load() method completes.

Extra parameters:

response - Contains the result data from the request

status - Contains the status of the request ("success", "notmodified", "error", " timeout", "parsererror")

xhr - Contains the XMLHttpRequest object

Instance

Load the contents of the file "demo_test.txt" into the specified

element:

$("button").click(function(){ $("#div1").load("demo_test.txt"); });
Copy after login

Recommended learning: "jquery video tutorial"

The above is the detailed content of What does load mean in jquery?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!