Rick Strahl's Weblog  

Wind, waves, code and everything in between...
.NET • C# • Markdown • WPF • All Things Web
Contact   •   Articles   •   Products   •   Support   •   Advertise
Sponsored by:
Markdown Monster - The Markdown Editor for Windows

jQuery Code Magazine Editorial Posted


:P
On this page:

My jQuery editorial for the Code Magazine Newsletter went live today. It turned into a rather lengthy affair (what else is new?) even though it's a high level editorial and so doesn't show code. The piece discusses jQuery's functionality, benefits and some considerations for ASP.NET integration, but keep in mind that this is an editorial discussion rather than a 'how to article' (which will follow soon). You can also post comments here if you like.

It's kind of funny - my editor Erik was poking me when I handed in my original draft that I didn't mention my usual 'downsides'. I didn't really think about it when I wrote the piece originally, but when he did I started giving this some thought. The funny thing is for me jQuery really hasn't had any issues that I would seriously consider as downsides. There are a few issues that can be problematic like versioning and there have been a few issues with the API documentation not being kept up to date with the latest releases, but either these issues haven't affected me or they are too minor to even worry about. Maybe that's just me, but I also didn't find any serious dissing of jQuery in searching around the Web trying to dig up some dirt on jQuery other than a few pointless rants. 

What do you think? Are there any major issues with jQuery that I'm simply overlooking or am I just running around in my rose colored glasses subconciously ignoring shortcomings?

Other jQuery News: jQuery 1.2.6 and jQuery UI released

Also, in case you missed it: jQuery 1.2.6 was released two weeks ago and jQuery.Ui released over the weekend. The last couple of jQuery releases (1.2.4 and 1.2.5) were short lived due to some distribution issues, but 1.2.6 has been out for a bit now and I've been running it since it came out without any problems with existing apps. jQuery 1.2.6  includes a few significant performance improvements as well as - finally - all the features of the original Dimensions Plugin integrated directly into the jQuery core. Dimensions provides a number of functions for determining and setting position and sizes of elements in a variety of different ways.

jQuery UI 1.5 also has been released finally and it really rocks. I've been using a bunch of the features - especially the drag and drop features and Sortables - and I'm glad to see this library finally come out after a long beta period and what I think was a botched 1.0 release that sucked. If by any chance you played with jQuery UI 1.0 and were turned off by bugs and inconsistent APIs, be sure to give Version 1.5 another look because it's been cleaned up and the API consolidated to provide consistency across the various components. Note that there are a few minor changes in library names in features from the beta versions, but they are really minor. The biggest is the file name changes for a few of the libraries especially if you were using earlier versions of the beta.

Also very cool is the dynamic library builder (which is something I always loved about the MooTools library) which lets you pick the components you need for your app and have the library builder create a single JS file with everything you need for those components. The tool figures out dependencies for each component, which is also useful if you plan on just picking and choosing which of the components to use and embedding them individually into the page.

On the downside the full jQuery.UI docs are still missing in action. There are older docs, but they're fairly incomplete and that's a bit disappointing given that some components require configuration with themes and css that need to be set up. Luckily there are examples that work and apparently the new jQuery.UI docs are coming shortly. I always wonder why any publisher considers documentation so secondary as to push out a release without adequate documentation? This is silly as it leaves a potentially bad impression on new developers rushing to check out a tool.

But I disgress... Regardless, jQuery.UI is great. If you're already using jQuery I think jQuery UI will be a no-brainer to check out and get friendly with.

Posted in jQuery  

The Voices of Reason


 

Grant Palin
June 10, 2008

# re: jQuery CoDe Magazine Editorial Posted

The variety of JavaScript frameworks and libraries on the web staggers me at times. And yet, among all of them, jQuery is the one that is most interesting to me. I keep meaning to download it and try using it in some project in another, but I'm too used to writing my own code.

Steve Gentile
June 10, 2008

# re: jQuery CoDe Magazine Editorial Posted

jQuery is just amazing as far as I'm concerned. I started really diving into it's capability when asp.net mvc came out. It is my focal point now of building web apps.

Validation, Ajax, Form support, input masking, file uploads, tables, table sorting, table paging, etc... just to name a few.

Powerful, easy to use, now I just wish my Visual Studio would give me jQuery refactoring support :)

Zubair.NET!
June 11, 2008

# re: jQuery CoDe Magazine Editorial Posted

hi Rick,

I read your editorial but we had a bit of a problem working with jQuery along with ASP.NET AJAX in our projects, we ended up choosing jQuery because our developers had more controls over some of the neat client-side tricks. But we realized that some of the things like implementing 'cascading dropdowns' for example are really simple with ASP.NET Ajax but a pain to implement with jQuery.

Can you show us an example of this "...the two libraries can seamlessly interact without stepping on each other.".

Rick Strahl
June 11, 2008

# re: jQuery Code Magazine Editorial Posted

Well, there may always be some things that one tool or another does better. I'm not really sure what you mean by Cascading Dropdowns here (autocomplete drop downs?), but you have to look at add-ins that provide this with jQuery - the core library doesn't provide high level components.

My point is that there are no conflicts and not a lot of feature overlap between the AJAX Client Library and what jQuery provides.

Let's hope that in the future Microsoft gets wise and adds similar functionality into the Microsoft AJAX Client library so another external tool may not be necessary if you are already using ASP.NET Ajax.

In the end using jQuery is a more low level approach and you need to think about it that way. You can certainly build integration between client features and server controls, but in many cases this may not even be necessary once you accept that you are willing to write some JavaScript to make your UI work and not rely on getting everything generated by an ASP.NET component automatically.

Steve from Pleasant Hill
June 11, 2008

# re: jQuery Code Magazine Editorial Posted

Great article. Have a client with a Winform app containing a browser control, which does a lot of painful DOM parsing of certain web pages. The value of their app is in the .NET parsing code, but after reading your article the DOM parsing capabilities of jQuery may be a better answer.

There are no .aspx pages in this app, so would jQuery even be an option?

Rick Strahl
June 11, 2008

# re: jQuery Code Magazine Editorial Posted

@Steve - yes jQuery is not bound to ASP.NET or any other server framework so that should work. One thing to consider though is that you'd have to get the JavaScript code into those pages in order to do anything with jQuery to them, so that may not work so easily.

It's been a while since I've done any Web Browser control development - but it'd be interesting to see what you can now accomplish using jQuery to provide some easier manipulation of the browser and for effects in the markup.

Stephen
June 11, 2008

# re: jQuery Code Magazine Editorial Posted

"What do you think? Are there any major issues with jQuery that I'm simply overlooking or am I just running around in my rose colored glasses subconsciously ignoring shortcomings?"

I hardly run into situations where that I am like "i wish jQuery did this differently", but when i do, it's so easy to tweak and extend that it's a non issue...

and the Google Group for jQuery is fantastic (lots of great questions and more importantly, lots of greater answers to said questions)

This framework has really changed the way i think about everything since i ditched MS Ajax and started using jQuery back in November.....

Mike Stegmann
June 11, 2008

# re: jQuery Code Magazine Editorial Posted

Rick,
FYI - Cascading drop downs (in Zubair's context i believe) are a set of drop-down lists [DD] with chained dependencies. In other words, the later DDs will have different items depending on the selected values of the earlier DDs. After selecting an item in the first DD, the second DD will load, and so on..there is a convenient pre-built cascading DD component in the asp.net ajax toolkit.

We also rode the fence between asp.net ajax and jquery (and even developed some hybrid solutions) for a short while before we weaned ourselves off the update panel and also chose jquery exclusively.

As far as I know, jquery hasn't tripped us up at all, nor do we see any deal-breaking shortcomings.

All in all, we're excited to see the new version in action.

Thanks for the post,
Mike

Rick Strahl
June 11, 2008

# re: jQuery Code Magazine Editorial Posted

@Stephen - that's happened to me as well. It's been a mind shift. Also indirectly I've gotten much better at JavaScript reviewing jQuery source and looking at a ton of plug-ins for extension as well as getting a much better understanding to CSS Selectors which honestly were more of an abstract idea to me prior to jQuery (beyond basic CSS classes, IDs and simple inheritance).

It's rare that at tool has such a cascading effect on changing perspective and usage scenarios at least for me.

Josh Stodola
June 11, 2008

# re: jQuery Code Magazine Editorial Posted

I'm with Grant; jQuery is very intriguing, but damn, I just love writing my own Javascript from scratch. A sense of satisfaction is gained from taking the hard way out and calling something "your own". Is it worthwhile? Dunno. Time will tell.

Regards...

Rick Strahl
June 11, 2008

# re: jQuery Code Magazine Editorial Posted

@Josh - I've been there. I've built my own library (and still use in combination with jQuery now) and it was well worth it for the learning experience. Lots gained from writing a library, but also lots of time wasted.

The thing about jQuery is that it's fairly non-intrusive so even if you have your own stuff it'll still fit right in and not feel out of place or make your stuff feel out of place. I just wish I had the time I could rewrite my library with jQuery and cut about half of the size :)...

David James
June 12, 2008

# re: jQuery Code Magazine Editorial Posted

I couldn't find any official documentation on the jquery website about the new "dynamic library builder" have you got a link so we can check it out? thanks.

Rick Strahl
June 12, 2008

# re: jQuery Code Magazine Editorial Posted

It's on the jQuery.ui site. jQuery is just a single file, so it doesn't need any dynamic building.

Grant Palin
June 13, 2008

# re: jQuery Code Magazine Editorial Posted

@Josh, @Rick

I do indeed get some satisfaction out of being able to use my own code, partly because I know what it does, having written it, and because I learn about writing good code at the same time.

I have written a small library with commonly-used utility functions, and it works well for me. I can reuse the library on other projects, and sometimes add another function to it if I find I am doing some particular code frequently enough.

West Wind  © Rick Strahl, West Wind Technologies, 2005 - 2024