{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 'registerNamespace(namespacePath)'
Method: registerNamespace(namespacePath)
Method Full Name:     Type$registerNamespace(namespacePath)
Class: Type
Namespace: Global (MicrosoftAjax.debug.js)
Source File: MicrosoftAjax.debug.js
1   Type.registerNamespace = function Type$registerNamespace(namespacePath) {
2     /// <summary locid="M:J#Type.registerNamespace" />
3     /// <param name="namespacePath" type="String"></param>
4     var e = Function._validateParams(arguments, [
5     {name: "namespacePath", type: String}
6     ]);
7     if (e) throw e;
8     if (!Type.__fullyQualifiedIdentifierRegExp.test(namespacePath)) throw Error.argument('namespacePath', Sys.Res.invalidNameSpace);
9     var rootObject = window;
10    var namespaceParts = namespacePath.split('.');
11    for (var i = 0; i < namespaceParts.length; i++) {
12      var currentPart = namespaceParts[i];
13      var ns = rootObject[currentPart];
14      if (ns && !ns.__namespace) {
15        throw Error.invalidOperation(String.format(Sys.Res.namespaceContainsObject, namespaceParts.splice(0, i + 1).join('.')));
16      }
17      if (!ns) {
18        ns = rootObject[currentPart] = {
19          __namespace: true,
20          __typeName: namespaceParts.slice(0, i + 1).join('.')
21          };
22        if (i === 0) {
23          Sys.__rootNamespaces[Sys.__rootNamespaces.length] = ns;
24        }
25        var parsedName;
26        try {
27          parsedName = eval(ns.__typeName);
28        }
29        catch(e) {
30          parsedName = null;
31        }
32        if (parsedName !== ns) {
33          delete rootObject[currentPart];
34          throw Error.argument('namespacePath', Sys.Res.invalidNameSpace);
35        }
36        ns.getName = function ns$getName() {return this.__typeName;}
37      }
38      rootObject = ns;
39    }
40  }
This is the JavaScript source for method registerNamespace(namespacePath) from ASP.NET AJAX Library. Full name for this method is Type$registerNamespace(namespacePath). It belongs to the class Type, which is in Global (MicrosoftAjax.debug.js) namespace. This source is in MicrosoftAjax.debug.js file.
Bookmark and Share This
About  Contact  Privacy Policy  Site Map