-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathdeferred.then.html
60 lines (59 loc) · 4.05 KB
/
deferred.then.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>deferred.then(doneFilter [, failFilter ] [, progressFilter ]) | jQuery API 涓枃鎵嬪唽</title>
<meta name="author" content="jQuery 涓枃鎵嬪唽 - hemin.cn/jq/">
<meta name="description" content="jQuery涓枃鎵嬪唽(鍦ㄧ嚎鐗�),浣滆��:hemin,鍦ㄧ嚎鎵嬪唽:hemin.cn/jq/,涓嬭浇:hemin.cn/jq/downloads/">
<link type="text/css" rel="stylesheet" href="style/style.css" tppabs="http://hemin.cn/jq/style/style.css" />
<script type="text/javascript" src="js/jquery.min.js" tppabs="http://hemin.cn/jq/js/jquery.min.js"></script>
<script type="text/javascript" src="js/js.js" tppabs="http://hemin.cn/jq/js/js.js"></script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-15318881-10', 'pandoraui.github.io');
ga('send', 'pageview');
</script>
</head>
<body id="split">
<div id="content" class="a2">
<div rel="deferred.then">
<h2><span>杩斿洖鍊�:Deferred Object</span>deferred.then(doneFilter [, failFilter ] [, progressFilter ])</h2>
<h3>姒傝堪</h3>
<div class="desc">
<p>娣诲姞澶勭悊绋嬪簭琚皟鐢ㄦ椂锛岄�掑欢瀵硅薄寰楀埌瑙e喅鎴栬�呮嫆缁濄��</p>
<div class="longdesc">
<p> 鎵�鏈変笁涓弬鏁帮紙鍖呮嫭progressCallbacks 锛屽湪jQuery鐨�1.7 锛夊彲浠ユ槸涓�涓崟鐙殑鍑芥暟鎴栦竴涓嚱鏁扮殑鏁扮粍銆� 鍏朵腑涓�涓弬鏁帮紝涔熷彲浠ヤ负绌猴紝濡傛灉娌℃湁璇ョ被鍨嬬殑鍥炶皟鏄渶瑕佺殑銆傛垨鑰咃紝浣跨敤.done()鎴�.fail()浠呰缃甦oneCallbacks鎴杅ailCallbacks銆傚綋閫掑欢瑙e喅锛宒oneCallbacks琚皟鐢ㄣ�傝嫢閫掑欢浠f浛鎷掔粷锛宖ailCallbacks琚皟鐢ㄣ�傚洖璋冩寜浠栦滑娣诲姞鐨勯『搴忔墽琛屻�備竴鏃eferred.then杩斿洖寤惰繜瀵硅薄锛屽欢杩熷璞$殑鍏跺畠鏂规硶涔熷彲浠ラ摼鎺ュ埌浜嗚繖閲岋紝鍖呮嫭澧炲姞.then()鏂规硶銆傛湁鍏宠缁嗕俊鎭紝璇峰弬闃呮枃浠�<a href="javascript:if(confirm('http://api.jquery.com/category/deferred-object/ \n\n文件并未依 Teleport Pro 取回,因为 它的域或路径超过开始网址中设置的范围。 \n\n你要从服务器上打开它吗?'))window.location='http://api.jquery.com/category/deferred-object/'" tppabs="http://api.jquery.com/category/deferred-object/">Deferred object</a> 銆�</p>
</div>
</div>
<h3>鍙傛暟</h3>
<div class="parameter">
<h4><strong>doneFilter [, failFilter ] [, progressFilter ] </strong><span>String</span><em>V1.8</em></h4>
<p><strong>doneFilter</strong>: 褰揇eferred锛堝欢杩燂級瀵硅薄寰楀埌瑙e喅鏃惰璋冪敤鐨勪竴涓嚱鏁般��</p>
<p><strong>failFilter</strong>: [鍙�塢褰揇eferred锛堝欢杩燂級瀵硅薄鎷掔粷鏃惰璋冪敤鐨勪竴涓嚱鏁般��</p>
<p><strong>progressFilter</strong>:[鍙�塢褰揇eferred锛堝欢杩燂級瀵硅薄鐢熸垚杩涘害閫氱煡鏃惰璋冪敤鐨勪竴涓嚱鏁般��</p>
<h4><strong>doneCallbacks,failCallbacks</strong><span>String</span><em>V1.5</em></h4>
<p><strong>doneCallbacks</strong>: 涓�涓嚱鏁版垨鍑芥暟鏁扮粍锛屽綋寤惰繜鎴愬姛鏃惰皟鐢ㄣ�� </p>
<p><strong>failCallbacks</strong>: 涓�涓嚱鏁版垨鍑芥暟鏁扮粍锛屽綋寤惰繜澶辫触鏃惰皟鐢ㄣ�� </p>
<h4><strong>doneCallbacks, failCallbacks [, progressCallbacks]</strong><span>String</span><em>V1.7</em></h4>
<p><strong>doneCallbacks</strong>: 涓�涓嚱鏁版垨鍑芥暟鏁扮粍锛屽綋寤惰繜瑙e喅鏃惰皟鐢ㄣ��</p>
<p><strong>failCallbacks</strong>: 涓�涓嚱鏁版垨鍑芥暟鏁扮粍锛屽綋寤惰繜鎷掔粷鏃惰皟鐢ㄣ��</p>
<p><strong>progressCallbacks:</strong> 涓�涓彲閫夌殑鍑芥暟锛屽綋寤惰繜瀵硅薄閫氱煡杩涘害锛坧rogress锛夋椂琚皟鐢ㄣ��</p>
</div>
<div class="example">
<h3>绀轰緥</h3>
<span id="f_ad2"></span>
<h4>鎻忚堪:</h4>
<p>涓�鏃Query.get鏂规硶杩斿洖涓�涓潵鑷欢杩熺殑瀵硅薄鐨刯qXHR瀵硅薄锛屾垜浠彲浠ラ檮鍔犱竴涓垚鍔熷洖璋冧娇鐢�.then鏂规硶銆�</p>
<h5>jQuery 浠g爜:</h5>
<pre><code>$.get("test.php").then(
function(){ alert("$.get succeeded"); },
function(){ alert("$.get failed!"); }
);</code></pre>
</div>
</div>
</div>
</body>
</html>