Ext.Ajax.request 用法引數介紹
阿新 • • 發佈:2019-01-01
url : String/Function (Optional)
(可選項)傳送請求的url,預設為配置的url。 若為函式型別那麼其作用域將由配置項 scope所指定。預設為配置好的URL。 The URL to which to send the request, or a function to call which returns a URL string. The scope of the function is specified by the scope option.
Defaults to configured URL.
params : Object/String/Function (可選項)(Optional)
一包含屬性的物件(這些屬性被用作request的引數)或一個編碼後的url字串或一個能呼叫其中任一一屬性的函式。 若為函式型別那麼其作用域將由配置項 scope 所指定。 An object containing properties which are used as parameters to the request, a url encoded string or a function to call
to get either. The scope of the function is specified by thescope option.
method : String (可選項)(Optional)
該請求所用的http方面,預設值為配置的方法,或者當沒有方法被配置時,如果沒有傳送引數時用get,有引數時用post。 The HTTP method to use for the request. Defaults to the configured method, or if no method was configured, "GET" if no parameters are being sent, and "POST" if parameters are being sent. Note
that the method name is case-sensitive and should be all caps.
callback : Function (可選項)(Optional)
該方法被呼叫時附上返回的http response物件。不管成功還是失敗,該回調函式都將被呼叫,該函式中傳入瞭如下引數: The function to be called upon receipt of the HTTP response. The callback is called regardless of success or failure and is passed the following parameters:
- options : Object >請求所呼叫的引數。The parameter to the request call.
- success : Boolean 請求成功則為true。True if the request succeeded.
- response : Object 包含了返回資料的xhr物件。The XMLHttpRequest object containing the response data. Seehttp://www.w3.org/TR/XMLHttpRequest/ for details about accessing elements of the response.
- response : Object 包含資料的xhr物件。The XMLHttpRequest object containing the response data.
- options : Object 請求所呼叫的引數。The parameter to the request call.
- response : Object 包含資料的xhr物件。 The XMLHttpRequest object containing the response data.
- options : Object 請求所呼叫的引數。 The parameter to the request call.