{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 '_resolveUrl(url, baseUrl)'
Method: _resolveUrl(url, baseUrl)
Method Full Name:     Sys$Net$WebRequest$_resolveUrl(url, baseUrl)
Class: WebRequest
Namespace: Sys.Net
Source File: MicrosoftAjax.debug.js
1   Sys.Net.WebRequest._resolveUrl = function Sys$Net$WebRequest$_resolveUrl(url, baseUrl) {
2     if (url && url.indexOf('://') !== -1) {
3       return url;
4     }
5     if (!baseUrl || baseUrl.length === 0) {
6       var baseElement = document.getElementsByTagName('base')[0];
7       if (baseElement && baseElement.href && baseElement.href.length > 0) {
8         baseUrl = baseElement.href;
9       }
10      else {
11        baseUrl = document.URL;
12      }
13    }
14    var qsStart = baseUrl.indexOf('?');
15    if (qsStart !== -1) {
16      baseUrl = baseUrl.substr(0, qsStart);
17    }
18    baseUrl = baseUrl.substr(0, baseUrl.lastIndexOf('/') + 1);
19    if (!url || url.length === 0) {
20      return baseUrl;
21    }
22    if (url.charAt(0) === '/') {
23      var slashslash = baseUrl.indexOf('://');
24      if (slashslash === -1) {
25        throw Error.argument("baseUrl", Sys.Res.badBaseUrl1);
26      }
27      var nextSlash = baseUrl.indexOf('/', slashslash + 3);
28      if (nextSlash === -1) {
29        throw Error.argument("baseUrl", Sys.Res.badBaseUrl2);
30      }
31      return baseUrl.substr(0, nextSlash) + url;
32    }
33    else {
34      var lastSlash = baseUrl.lastIndexOf('/');
35      if (lastSlash === -1) {
36        throw Error.argument("baseUrl", Sys.Res.badBaseUrl3);
37      }
38      return baseUrl.substr(0, lastSlash+1) + url;
39    }
40  }
This is the JavaScript source for method _resolveUrl(url, baseUrl) from ASP.NET AJAX Library. Full name for this method is Sys$Net$WebRequest$_resolveUrl(url, baseUrl). It belongs to the class WebRequest, which is in Sys.Net namespace. This source is in MicrosoftAjax.debug.js file.
Bookmark and Share This
About  Contact  Privacy Policy  Site Map