1. 程式人生 > >Ext.Ajax.request 用法引數介紹

Ext.Ajax.request 用法引數介紹

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.
success: Function (可選項)(Optional) 該函式被呼叫取決於請求是否成功。該回調函式被傳入如下引數: The function to be called upon success of the request. The callback is passed the following parameters:
  • response : Object 包含資料的xhr物件。The XMLHttpRequest object containing the response data.
  • options : Object 請求所呼叫的引數。The parameter to the request call.
failure : Function (可選項)(Optional) 該函式被呼叫取決於請求失敗。該回調函式被傳入如下引數: The function to be called upon failure of the request. The callback is passed the following parameters:
  • response : Object 包含資料的xhr物件。 The XMLHttpRequest object containing the response data.
  • options : Object 請求所呼叫的引數。 The parameter to the request call.
scope : Object (可選項)(Optional) 回撥函式的作用域:回撥函式"this"物件指標。預設值為瀏覽器視窗。 The scope in which to execute the callbacks: The "this" object for the callback function. If the url, or params options were specified as functions from which to draw values, then this also serves as the scope for those function calls. Defaults to the browser window. form : Element/HTMLElement/String (可選項)(Optional) 用來壓入引數的一個 <form>元素或 <form>的標識。 The <form> Element or the id of the <form> to pull parameters from. isUpload : Boolean (可選項)(Optional) 如果該form物件是上傳form,為true(通常情況下會自動探測)