Client-Side AJAX files
If you installed the MS AJAX at its default location, you can find six .js files in the following location:
C:\Program Files\Microsoft ASP.NET\ASP.NET 2.0 AJAX Extensions\v1.0.61025\MicrosoftAjaxLibrary\System.Web.Extensions?.0.61025.0
This directory contains the release and debug versions of the client-side JavaScript files:
MicrosoftAjax.js
MicrsofotAjaxTimer.js
MicrosoftAjaxWebForms.js
On the production (release) environments the above js files get downloaded to the client machine. However, since they are stripped off all the comments and line breaks, they are not read-friendly. However, if you want to read and understand these files, you can open up the debug versions of these files in the same directory:
MicrosoftAjax.debug.js
MicrosoftAjaxTimer.debug.js
MicrosoftAjaxWebForms.debug.js
The size of the release version of these files (i.e. the comments stripped and line breaks taken out) is reduced by 50-67% over the size of the debug version. The sizes of the debug and release versions of these files are shown below:
MicrosoftAjax.js 254KB vs. 82KB (67% reduction)
MicrosoftAjaxTimer.js 6KB vs. 3KB (50% reduction)
MicrosoftAjaxWebForms.js 65KB vs. 29KB (55% reduction)
Typically the JavaScript files in the old days used to be sparsely commented because that would add to the download time this would be downloaded for each user (and in some situations for each access). However, in this case, the comment-stripping mechanism is added to these libraries, and hence the release files are not longer than necessary.
Removing the newline/linebreak characters not only reduces the size of the file, it also makes it difficult to the power user / another developer ‘reverse-engineer’ your code. If you open the release version of MicrosoftAjax.js file, the first code line stretches on to 80 thousand characters. Without a lot of time in one’s hands, it would be difficult to make sense of the code (Obviously, the obfuscation is not the aim in case of Microsoft Ajax library – the fully-documented source code is available).
What we discussed above is the client side source code (the JavaScript code). However, MS AJAX has both client-side and server-side components to it. The server-side code is written in C# and is available at the following location:
C:\Program Files\Microsoft ASP.NET\ASP.NET 2.0 AJAX Extensions\v1.0.61025\Source
Related Articles
How does the MicrosoftAjax.js provide the basic AJAX functionality?