ASP.NET AJAX Framework vs jQuery
What is the difference between AJAX and jQuery. Does both of them do the same thing.If they do what are the pros and cons of each. I'开发者_如何学编程m trying to learn ASP.NET AJAX but not sure if jQuery offers the same features??
Thanks.
MS AJAX library and jQuery are both decent JavaScript libraries that are equally capable of fulfilling the UI needs for an ASP.NET application. The way that each is organised and the approach taken is quite different between the two -
jQuery is based largely around the $
function - it is the constructor for objects that wrap elements matching a given selector, plugins are provided by extending the function prototype
and utility functions are provided as properties on the function object.
The Microsoft AJAX library on the other hand takes the approach of extending the prototype
of some of JavaScript's native objects and providing useful functions organised within namespaces that should feel familiar to .NET developers. Many of the idioms of programming in your favourite .NET language have been graphed into a JavaScript library.
Having used both considerably, I personally prefer jQuery. For me, it feels more intuitive to use and get things done. The development of jQuery is much more active (in fact I believe that the MS Ajax library will have no more development put into it by Microsoft, with their focus being more on jQuery now as the preferred client side solution) and is more lightweight than MS Ajax. I'm comfortable with the fact that JavaScript is a completely different beast to C# .NET programming and I like to embrace that difference and follow the idioms and conventions that are established for the language.
精彩评论