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

|

Comcast deal for NBC Universal is about content, not broadband

Although Comcast is certainly America's largest broadband provider, at least for PCs, in most regards, today's deal with GE may not impact the Internet at all.

The Black Screen Syndrome, or, Tech news in search of the apocalypse

Scott Fulton On Point: This is a story about something that should not have been a story, about something that at one time was a story.

Five compact digital camera myths and realities

This holiday 2009 primer offers tips on what and what not to look for in a compact digital camera.

Mark Russinovich on MinWin, the new core of Windows

The next version of Windows three years hence will likely build onto a significant architectural change implemented in Windows 7 and Server 2008 R2.

Android team updates 'Donut' and 'Eclair' SDKs

The Android SDK includes components which optimize app development for each version of the mobile operating system. Today, the 1.6 and 2.0 components got updates.

See ya later, WinMo: Microsoft's mobile strategy needs a reboot

Carmi Levy | Wide Angle Zoom: Hands up if you're considering upgrading to a Windows phone for the holidays...Anybody?

Online advertising evolves away from display, toward interactive software

Marketing departments and agencies are increasingly establishing positions for "creative technologists" who can steer designers and developers toward platforms that enable direct connections with consumers.

Google begrudgingly adjusts news crawling for paid publishers

If publishers want to make readers pay for news content, and thereby drive down its popularity and Google ranking, the company says, they can just go right on ahead.

Fee or free? Murdoch, Huffington square off over the cost of Internet news

Participants in an FTC workshop yesterday witnessed the two extremes of the Web news publishing debate, still centered on the issue of long-term profitability.

Security firm: Windows patches not responsible for 'Black Screen of Death'

On second thought, maybe that access control list thingie with the lockdown something-or-rather didn't trigger an alleged, perhaps non-existent, pandemic.

Apple settles with Psystar except for 'circumvention devices'

The fracas with the Florida clone computer maker might have ended today had Apple not have muddled the issue over a cheap piece of Psystar software.