{infiniteZest}
// Articles. Tutorials. Utilities.
Home  |   Search  |   Login  
Categories Skip Navigation Links
New / All
AJAX
Apple
ASP.NET
.NET
Git
Google / Android
Python / IronPython
Miscellaneous
SQL Server
AJAX Source Viewer
View the source code of a Method from ASP.NET AJAX Library. Choose a method from the menu items above (Namespaces, Classes, or Methods).
Method 'executeRequest()'
Method: executeRequest()
Method Full Name:     Sys$Net$XMLHttpExecutor$executeRequest()
Class: XMLHttpExecutor
Namespace: Sys.Net
Source File: MicrosoftAjax.debug.js
1   function Sys$Net$XMLHttpExecutor$executeRequest() {
2     /// <summary locid="M:J#this._onTimeout" />
3     if (arguments.length !== 0) throw Error.parameterCount();
4     this._webRequest = this.get_webRequest();
5     if (this._started) {
6       throw Error.invalidOperation(String.format(Sys.Res.cannotCallOnceStarted, 'executeRequest'));
7     }
8     if (this._webRequest === null) {
9       throw Error.invalidOperation(Sys.Res.nullWebRequest);
10    }
11    var body = this._webRequest.get_body();
12    var headers = this._webRequest.get_headers();
13    this._xmlHttpRequest = new XMLHttpRequest();
14    this._xmlHttpRequest.onreadystatechange = this._onReadyStateChange;
15    var verb = this._webRequest.get_httpVerb();
16    this._xmlHttpRequest.open(verb, this._webRequest.getResolvedUrl(), true );
17    if (headers) {
18      for (var header in headers) {
19        var val = headers[header];
20        if (typeof(val) !== "function")
21        this._xmlHttpRequest.setRequestHeader(header, val);
22      }
23    }
24    if (verb.toLowerCase() === "post") {
25      if ((headers === null) || !headers['Content-Type']) {
26        this._xmlHttpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=utf-8');
27      }
28      if (!body) {
29        body = "";
30      }
31    }
32    var timeout = this._webRequest.get_timeout();
33    if (timeout > 0) {
34      this._timer = window.setTimeout(Function.createDelegate(this, this._onTimeout), timeout);
35    }
36    this._xmlHttpRequest.send(body);
37    this._started = true;
38  }
This is the JavaScript source for method executeRequest() from ASP.NET AJAX Library. Full name for this method is Sys$Net$XMLHttpExecutor$executeRequest(). It belongs to the class XMLHttpExecutor, which is in Sys.Net namespace. This source is in MicrosoftAjax.debug.js file.
Bookmark and Share This
About  Contact  Privacy Policy  Site Map