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

|

Google Chrome 4: Yes, it's fast, but is it usable?

As Betanews readers have responded to our stories about Chrome's JavaScript superiority...Does that mean we'd actually use this browser? Well...

Video: Netflix on PlayStation 3

Netflix has come to the PlayStation 3 via Blu-ray and BD-Live.

Verizon Wireless launches new Android, Chocolate, and ruggedized phones

The lower-priced Eris joins the Droid, while the Chocolate gets a touchscreen and more music playback.

Early sales figures for Windows 7 nicely high, but do we know why?

Fans of triple-digit surges in figures quoted by Betanews will love this one, as it appears Microsoft rediscovered how to pull off a software launch.

Myka announces its latest Linux-based 'net top box'

Myka's ION brings Boxee, XMBC, and much more to HDTVs.

What hath Mac wrought? A remembrance after a quarter-century

The reason there's a Macintosh today is not because of some brilliant flash of engineering genius, but because Apple had the audacity to learn from its mistakes.

Early build of Moblin 2.1 improves connectivity, but not device support

The Linux Foundation's Atom-centric OS yesterday received a major overhaul with the project release of Moblin 2.1 for netbooks and nettops.

The iPhone's China syndrome: Sales of 5,000 and climbing

There's actually a country where Apple's device is not a godsend, where sales can be measured in the dozens.

New European counterpart to FCC will ensure 'a more neutral net'

Late Thursday night, the ruling telecom administrators of the EU's member nations signed away their final authority to a new entity overseen by the EC.

Sophos study suggests Windows 7 UAC's default setting is self-defeating

Without any anti-virus installed, a Sophos test showed, User Account Control was only capable of thwarting just one malware package out of ten samples chosen.

Indiscreet tweet trips awareness of Web SSL vulnerability

A group of high-level security engineers had been making progress on thwarting a low-level threat to the Web, until somebody blurted it all out on Twitter.