jQuery load() 方法
jQuery 教程
· 2019-03-28 16:56:34
实例
把文件 "demo_test.txt" 的内容加载到指定的 <div> 元素:
$("button").click(function(){
$("#div1").load("demo_test.txt");
});
定义和用法
load() 方法从服务器加载数据,并把返回的数据放置到指定的元素中。
注意:还存在一个名为 load 的 jQuery 事件方法。调用哪个,取决于参数。
语法
$(selector).load(url,data,function(response,status,xhr))
| 参数 | 描述 |
|---|---|
| url | 必需。规定您需要加载的 URL。 |
| data | 可选。规定连同请求发送到服务器的数据。 |
| function(response,status,xhr) |
可选。规定 load() 方法完成时运行的回调函数。 额外的参数:
|
点击查看所有 jQuery 教程 文章: https://codercto.com/courses/l/35.html
The Book of CSS3
Peter Gasston / No Starch Press / 2011-5-13 / USD 34.95
CSS3 is the technology behind most of the eye-catching visuals on the Web today, but the official documentation can be dry and hard to follow. Luckily, The Book of CSS3 distills the heady technical la......一起来看看 《The Book of CSS3》 这本书的介绍吧!