jQuery – ajax逾時處理

來源:互聯網
上載者:User
 

jQuery - ajax逾時處理
[範例程式碼]


<html>
    <head>
        <script src="jquery-1.3.1.js"></script>
        <script>
            $(document).ready(
                function () {
                    $.ajax({
                        url: "jQuery - ajax.php",
                        timeout: 1000,
                        error: function (xmlHttpRequest, error) {
                            console.log(xmlHttpRequest, error);
                        }
                    });
                }
            );
        </script>
    </head>
</html>

[範例程式碼 - jQuery - ajax.php]


<?php

sleep(2);

?>


[jQuery的ajax]

http://docs.jquery.com/Ajax/jQuery.ajax

[jQuery - 官方網站]

http://jquery.com/

[jQuery - download下載]

目前的版本, http://docs.jquery.com/Release:jQuery_1.3.1
下載列表, http://docs.jquery.com/Downloading_jQuery
最新代碼, http://code.jquery.com/nightlies/jquery-nightly.js

[jQuery - 相關論壇]

http://groups.google.com/group/jquery-en
http://WebDev.board.newsmth.net/
http://WebGeeks.board.newsmth.net/
http://bbs.pku.edu.cn/, homepage看版
http://forum.csdn.net/SList/JavaScript/

[jQuery - 關鍵詞]

jQuery

[jQuery - 文檔]

http://docs.jquery.com/Main_Page

[jQuery - Core核心]

each迭代, http://docs.jquery.com/Core/each
jQuery, http://docs.jquery.com/Core/jQuery

[jQuery - Ajax]

jQuery的Ajax文檔, http://docs.jquery.com/Ajax/jQuery.ajax
jQuery的Ajax選項,http://docs.jquery.com/Ajax/jQuery.ajax#options
dataType選項,設定傳回值類型
timeout選項,用於設定逾時
與PHP整合可以使用json_encode返回結果, http://www.php.net/manual/zh/function.json-encode.php

readyState擷取請求操作的目前狀態, http://msdn2.microsoft.com/en-us/library/ms534361.aspx

[jQuery - 特效]

jQuery淡入特效,http://docs.jquery.com/Effects/fadeIn

[jQuery - Selectors選取器]

表單元素選取器, http://docs.jquery.com/DOM/Traversing/Selectors#Form_Selectors
屬性相等選取器,http://docs.jquery.com/Selectors/attributeEquals
checked選中, http://docs.jquery.com/Selectors/checked

:input匹配所有input, textarea, select和button元素, http://docs.jquery.com/Selectors/input

選取器在選擇body中出現的title標記時,會出現和預期不同的效果。

element按指定名稱匹配所有元素, http://docs.jquery.com/Selectors/element

[jQuery - Attributes屬性]

val擷取第一個匹配元素value屬性的內容, http://docs.jquery.com/Attributes/val

[jQuery - 常用函數]
attr訪問自訂屬性,減少javascript指令碼中代碼和資料的耦合

filter, 用於在集合中過濾元素

[jQuery - Events事件]

hover, http://docs.jquery.com/Events/hover
submit提交, http://docs.jquery.com/Events/submit

focus響應每個匹配元素的焦時間點事件, http://docs.jquery.com/Events/focus

click單擊, 觸發每個匹配元素的單擊事件, 綁定函數到每個匹配元素的單擊事件, http://docs.jquery.com/Events/click

[jQuery - Manipulation操作]

after在每個匹配的元素之後插入內容, http://docs.jquery.com/Manipulation/after

[jQuery - Traversing遍曆器]

filter過濾, http://docs.jquery.com/Traversing/filter
find尋找, http://docs.jquery.com/Traversing/find

[jQuery - Tutorials教程]

Introducing $(document).ready(), http://docs.jquery.com/Tutorials:Introducing_%24%28document%29.ready%28%29

[jQuery - plugins外掛程式]

Easing動畫, http://jquery.com/plugins/project/easing
jCarouseLite, 走馬燈效果, http://jquery.com/plugins/project/jCarouselLite
tableFilter, 表過濾器, http://jquery.com/plugins/project/tableFilter
Rounded Corner圓角矩形, http://docs.jquery.com/Tutorials:Rounded_Corners#Rounded_Corners_Without_Images

Jeditable原位置編輯器外掛程式, http://plugins.jquery.com/project/jeditable

[jQuery - Utilities工具 + 生產力]

trim去掉字串前後的空格, http://docs.jquery.com/Utilities/jQuery.trim

[jQuery - UI]

UI, http://docs.jquery.com/UI
UI/Theming, http://docs.jquery.com/UI/Theming

[jQuery - 參考資料]

http://www.json.org/, http://www.json.org/json.js

JScript (Windows Script Technologies):, http://msdn2.microsoft.com/en-us/library/hbxc2t98.aspx

prototype Property (JScript 5.6):, http://msdn2.microsoft.com/en-us/library/f5s9ycex.aspx

parseInt Method (JScript 5.6):, http://msdn2.microsoft.com/en-us/library/x53yedee.aspx

toString Method (JScript 5.6):, http://msdn2.microsoft.com/en-us/library/k6xhc6yc.aspx

HTTP Status Codes (Windows):, http://msdn2.microsoft.com/en-us/library/Aa384325.aspx

HTML+TIME:, http://msdn2.microsoft.com/en-us/library/ms533112.aspx

HTA:APPLICATION對象, http://msdn2.microsoft.com/en-us/library/ms536495.aspx

About Cross-Frame Scripting and Security:關於跨架構指令碼和安全, http://msdn2.microsoft.com/en-us/library/ms533028.aspx

How to Build Tables Dynamically:如何動態構建表格, http://msdn2.microsoft.com/en-us/library/ms532998.aspx

Filter Property (Tabular Data Control): - Filter屬性(表格式資料控制項), http://msdn2.microsoft.com/en-us/library/ms531364.aspx

close Method (window):, http://msdn2.microsoft.com/en-us/library/ms536367.aspx

ECMA標準下載, http://www.ecma-international.org/publications/standards/Ecma-262.htm

parseInt Method (JScript 5.6): - IE標準, http://msdn2.microsoft.com/en-us/library/x53yedee.aspx

complete Property (IMG, INPUT, INPUT type=image):, http://msdn2.microsoft.com/en-us/library/ms533688.aspx

fireEvent Method (A, ABBR, ACRONYM, ...):, http://msdn2.microsoft.com/en-us/library/ms536423.aspx

SunSpider JavaScript Benchmark: JavaScript效能測試, http://webkit.org/perf/sunspider-0.9/sunspider.html

onbeforeunload Event (BODY, FRAMESET, window):, http://msdn2.microsoft.com/en-us/library/ms536907.aspx

 

 

 

[jQuery - 綜合執行個體]

實現前一個和後一個效果

跨視窗調用函數

定時重新整理

下拉式清單方塊開啟指定網站

產生在兩個邊界間的隨機數
文本輸入框與標籤自動更換

密碼輸入框與標籤自動更換

文本輸入地區與標籤自動更換

Pre標籤在IE與Firefox下效果相對理想的換行處理

固定表頭,滾動表格內容

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.