jQuery函式學習之七 Ajax部分

2022-02-05 12:27:12 字數 1801 閱讀 7397

&location

=boston",

success: function(msg)

});jquery code

var html = $.ajax().responsetext;

jquery code

var xmldocument = [create xml document];

$.ajax();

函式:$.ajaxsetup(settings),$.ajaxtimeout(time)

功能:設定請求的一些引數

返回:undefined

例子:$.ajaxsetup(  );

$.ajaxtimeout( 5000 );

函式:$.get(url, params, callback),$.getifmodified(url, params, callback),

$.getjson(url, params, callback),$.getscript(url, callback)

功能:get方式提交資料

例子:$.get("test.cgi",

,function(data)

);函式:$.post(url, params, callback)

功能:post方式提交資料

例子:$.post("test.cgi",

,function(data)

);<

li>

request complete.

li>

<

li>

successful request!

li>

<

li>

starting request at " + settings.url + "

li>

");});

函式:load(url, params, callback),loadifmodified(url, params, callback)

功能:載入html內容

返回:jquery物件

引數:同get和post方式提交

例子:jquery code

$("#feeds").load("feeds.html");

before

<

div 

id="feeds"

>

div>

result:

<

div 

id="feeds"

><

b>45b

>

feeds found.

div>

jquery code

$("#feeds").load("feeds.html",

,function() 

函式:serialize()

功能:將表單元素和值序列化成string

返回:string 

例子:jquery code

$("input[@type=text]").serialize();

before

<

input 

type

='text' 

name

='name' 

value

='john'

/>

<

input 

type

='text' 

name

='location' 

value

='boston'/

result

name

=john&location=boston

jQuery函式學習之八 Effects部分

這一節我們來學習一下jquery實現一些動畫的函式,我初步試驗了一下,效果非常不錯。以前純粹自己實現的漸顯,漸隱等 要寫很多 的,現在基本一行搞定,大家可以試試哦。函式 animate params,speed,easing,callback 功能 這是個用來設定自定義動畫的函式,這個函式的關鍵之處...

jQuery函式學習之五 css部分

也就是對dom元素中的樣式進行操作 函式 css name 功能 獲取匹配元素指定屬性名的值 返回 string 引數 要訪問的樣式屬性名 例子 retrieves the color style of the first paragraph jquery code p css color befo...

jQuery學習之七 CSS

這一篇,話不多說,直接來學習吧,我覺得很重要 1 css name pro val fn 訪問匹配元素的樣式屬性。引數解析 name 要訪問的屬性名稱 properties 要設定為樣式屬性的名 值對 name,value 屬性名,屬性值 name,function index,value 屬性名 ...