jquery load
时间: 2023-11-18 19:59:32 浏览: 53
jQuery load() is a method that allows you to load data from a server and place the returned HTML into a specified element on a webpage. It is a shorthand method for the jQuery AJAX method, which is used to send and receive data asynchronously from a server.
The syntax for the load() method is:
```javascript
$(selector).load(url, [data], [callback]);
```
- `selector`: the element where the returned data will be placed
- `url`: the URL of the server-side script that will return the data
- `data` (optional): data that will be sent to the server-side script
- `callback` (optional): a function that will be executed after the data is loaded
The load() method is commonly used to load content dynamically, without having to refresh the entire page. For example, you can use the load() method to load new content into a div element when a user clicks a button, or to refresh a section of a webpage periodically.