ASP.NET Ajax Tutorial Lesson 6. Javascript Extensions

Before building their client-side Ajax library, Microsoft decided to provide general language extensions for. The following gives a very quick synopsis of the kind of things found within it.

Firstly, there are useful extensions to the Javascript base types, such as Array, Number and String. To take an example, the String class has been extended to have a String.endsWith() function. A StringBuilder object is also included.

Secondly, there are browser-independent classes used for accessing and manipulating the DOM, such as DomElement and DomEvent. There are also useful shortcuts for common tasks, such as the $get() method, which does a getElementById() lookup.

Thirdly, there is a framework to improve object oriented development and make developing in Javascript more akin to developing in .NET. This includes support for namespaces, interfaces, reflection, etc.

Fourthly, there is support for ‘components’, where these are i. Non Visual Components (reusable slices of code with no UI), ii. Behaviors (functional or visual extensions to existing elements) & iii. Controls (core visual components with Dom elements).