New Microsoft support for jQuery makes part of its platform open source

By Scott M. Fulton, III | Published September 30, 2008, 3:38 PM

One of the most exciting innovations in JavaScript is a tiny little open source library that makes functionality directly assignable to objects rather than to events. The surprise is that Microsoft has signed on as its key distributor.

It is now an established fact that JavaScript is the functionality language of the Web; and although it was Netscape that introduced us to it, and although those responsible are now at Mozilla, it's Microsoft that has taken the lead in recent years in accelerating its evolution. One major step was its embrace of AJAX two years ago. Another step, announced yesterday, may be just as big: the inclusion in its standard JavaScript of a very small, very potent library called jQuery that alters the dynamics of how Web pages work.

A key part of the programming model originally made popular in the early '90s by Visual Basic is the event-driven concept, where an application waits for a recognized event to occur, so that the event can trigger the execution of a procedure. The event model is simpler on a closed system, but Web programming mandates a more asynchronous approach, because the browser and the server are running independent processes, and there could be middleware -- perhaps a cloud service -- somewhere in between.

While jQuery sounds like a database language, that's not the category to which "Query" refers in this instance. Here, the idea is to change the response model for programming, so that the dynamics become less reliant upon if something happens -- less reactionary -- and more forward-thinking: when something happens.

With JavaScript code, you often have event functions that respond to a given trigger. For example, you may have a function that responds to the .onload event for the window object representing the active document, and you may have several functions that respond to the .onclick event for an object or a class of object. These functions are often assigned to the event as though they were values unto themselves, using the assignment operator =.

With jQuery added, the concepts are radically simplified. Rather than write out a whole bunch of event handling functions as if the events were the subjects, you maintain the context of the objects you're working on using the event names as modifiers of that object.

Here's an example from the jQuery team's John Resig: Suppose a list element in a page has been given the name orderedlist. A default function, using jQuery syntax, responds to the event signaling the active document being "ready" (fully rendered) by forwarding a set of event-oriented instructions saying, in effect, "When the user hovers over the last element in this list, turn it green until the pointer strays off of it."

$(document).ready(function() {
 $("#orderedlist li:last").hover(function()
 { $(this).addClass("green");
 },function(){
 $(this).removeClass("green");
 });
});

The li:last part is based on an XPath selector that has the script look for the final item in the list. The .hover event is something you'll recognize because it's a common term, but here it's being referenced as a method of the class that's returned by the selector. So every method chained onto to the end thereafter refers to the same object, and every reference to $(this) also refers to the same object -- it's shorthand for "the object at hand." So the .addClass and .removeClass jQuery functions are passed as parameters to the .hover event, essentially assigning and removing, respectively, a pre-existing CSS class green to that "object at hand."

As John Resig announced in a blog post on Sunday, "Microsoft is looking to make jQuery part of their official development platform. Their JavaScript offering today includes the ASP.NET AJAX Framework and they're looking to expand it with the use of jQuery. This means that jQuery will be distributed with Visual Studio (which will include jQuery Intellisense, snippets, examples, and documentation)."

Microsoft Vice President and ASP.NET development team leader Scott Guthrie announced this in his blog Sunday: "Providing the ability to perform selection and animation operations like above is something that a lot of developers have asked us to add to ASP.NET AJAX, and this support was something we listed as a proposed feature in the ASP.NET AJAX Roadmap we published a few months ago. As the team started to investigate building it, though, they quickly realized that the jQuery support for these scenarios is already excellent, and that there is a huge ecosystem and community built up around it already...Rather than duplicate functionality, we thought, wouldn't it be great to just use jQuery as-is, and add it as a standard, supported, library in VS/ASP.NET, and then focus our energy building new features that took advantage of it?"

As Microsoft Senior Program Manager Scott Hanselman confirmed Sunday, jQuery will eventually be shipped as part of Visual Studio, but will in the meantime be distributed as part of the new ASP.NET Model View Controller.

This officially makes an open source component part of Microsoft's standard Web page development platform.

"This is cool because we're using jQuery just as it is. It's Open Source, and we'll use it and ship it via its MIT license, unchanged. If there's changes we want, we'll submit a patch just like anyone else," Hanselman wrote. "Folks have said Microsoft would never include Open Source in the platform, I'm hoping this move is representative of a bright future."

Comments

View comments by with a score of at least

So if I read this correctly, the gist is that they want to add jQuery to the existing ASP.NET AJAX framework. Just a wild guess here, but wouldn't that likely create consistancy issues and perhaps redundancy?

Score: 0

|

Hmmm didn't Microsoft "embrace" Java once too? (Creating the headless corpse that is now J++) It was part of their "Embrace, Extend and Corrupt" policy towards competition.

My advice to all involved with the maintenance of jQuery is don't get too close to MS, and definitely NEVER rely on them for anything.

Score: 0

|

Spoken like a true MS hater.

jQuery is awesome and having MS' support would make it even better.

BTW, J++ is Java and not JavaScript. Java and JavaScript are two different languages. Do your homework. They are as different as VB and VBscript. Similar but not the same.

Score: 0

|

It's funny though that Microsoft Java Virtual Machine still runs faster than Sun's - even after so many years and performance tweaks.

Score: 0

|

Brusco didn't say they were the same, he cautioned against accepting Microsoft aid.
J++ is NOT java ( see court decision), it is what is left of java after speed is maximized and thus security is trashed.

Score: 0

|

Microsoft's Bob Muglia and Ray Ozzie on Silverlight vs. standards

Bob Muglia: "We're trying to provide people with an environment that has capabilities that you just simply can't do today in the standards-based world."

Uh-oh, netbooks -- not Windows 7 -- will lift 2009 PC sales

Santa may bring a lump of coal to the Windows PC industry this holiday season. Netbook sales will sap PC margins, while weak Windows 7 PC sales could further drive down average selling prices.

Google's value proposition for Chrome OS: Should we feel insulted?

For a search engine that has direct access to all the world's online history, it appears to have taught Google nothing about selling a machine.

PDC 2009: What have we learned this week?

There was the freebie that no one will forget, the heebie-jeebies courtesy of Scott Guthrie, and a teensy bit clearer picture of how this cloud thingie should work.

Where there's smoke: Apple warranty stance raises troubling questions

Carmi Levy | Wide Angle Zoom: Smoking can be dangerous not only for your lungs, it appears, but for your Apple hardware warranty.

Microsoft's .NET Micro Framework is now free and open source

The latest version of Microsoft's .NET Micro framework is now in the hands of the FOSS community.

E-book readers will be in short supply this holiday season

E-readers are hot this year, and a lot of compelling new products have been released, but are there enough electrophoretic displays to go around?

Sony looks to finally open a single storefront for downloads

Sony has had many different download portals for movies, music, e-books, and games, and now it's looking to make a single shop for all of it.

Tuning out the tablet: Time to give the endless speculation a rest

Wide Angle Zoom: Wishing and hoping and thinking and praying....won't put an iTablet on the market.

Five improvements for IT managers in 2010

If businesses are to improve their efficiency for next year, they need to stop and reassess the basic tenets of their job.

Live report: Will Google Chrome OS change Linux?

The mysteries of just what Chrome OS is, and how much of an operating system it truly is, may be resolved today.