內容:
- jQuery特點
- CSS選取器用法
- jQuery集合
- jQuery集合操作
- 擷取匹配元素的值
- DOM元素遍曆
- 事件處理
- 安靜載入運行
- 對象鏈串訪問
- 瘋狂鏈串(Crazy Chaining)
- Ajax用法
- 推薦了幾個外掛程式
------------------------------------------------------------------------------------------------------
What makes jQuery interesting?
• Built around CSS selectors
• Well behaved
• Doesn’t hijack your global namespace
• Plays well with other libraries
• API designed with conciseness and convenience as the driving factors
-------------------------------------------------------------------------------------------------------
The jQuery() function
jQuery('div#intro h2')
jQuery('div.section > p')
jQuery('input:radio')
$('div#intro h2')
--------------------------------------------------------------------------------------------------------
jQuery collections
• $('div.section') returns a jQuery collection
• You can call methods on it:
$('div.section').size() = no. of matched elements
$('div.section').each(function(div) {
// Manipulate the div
}
---------------------------------------------------------------------------------------------------------