jQuery is emerging as the JavaScript library of choice for developers looking to ease their creation of dynamic Rich Internet Applications. As browser-based applications continue to replace desktop applications, the use of these libraries will only continue to grow. See jQuery in action, its easy syntax, how to use jQuery correctly in your own JavaScript code in your browser app, and how to avoid any pitfalls when using it with other libraries.
“jQuery is emerging as the JavaScript library of choice”
ORLY?
Yours Truly,
Javascript Programmer.
(I roll with Prototype, Moo or often wirte my own; just commenting to represent some diversity)
I’m with you. jQuery is certainly popular, but how is Prototype not higher on that list? It’s everywhere!
Well Dojo, Prototype and JQuery are probably the most popular. I personally think that the prototype approach is problematic.
The hijacking of operators like $ and extending base objects like array other elements has been a huge headache in the past and to some degree still are.
Every time the developers were asked to fix this they said that it was allowed to do it. Well yes, it is also allowed to turn on the radio very loudly until late in the night in many countries that does not imply that you should do it.
Dojo has a saner approach, they simply reserve a namespace of their own and try not to interfere!
Prototype is one of the examples of an excellent but way too intrusive library which exactly for its extreme intrusiveness should not have been become standard in some frameworks!
That’s not unique to Prototype though. jQuery does it too.
The obtrusiveness is a good thing in the situation where you are not trying to use multiple frameworks together (something you should never do).
I like Prototype because it lets me program in a way that feels natural, as if it were an ideal Javascript world where there weren’t all these browser differences.
If you write code that integrates tightly with Prototype, then it works very well. Prototype is designed for writing full applications, rather than the odd bit of interactivity here and there.
Actually this is sort of a “stupid” comment. Sorry for saying that, but mixing in no language is a problem if the libraries use the basic software design principles of namespacing.
The only libraries I have seen so far problematic to that in the javascript world are prototype and jquery, because they simply ignore how to reserve your own namespace but hijack the language itself.
From prototype I know that it at least has caused a load of problems in other frameworks for doing it. (most of the times you dont have a choice to rely only on one lib, even your own code might break if a library hijacks the array and object elements of the language and then destroys the workability of foreach constructs)
Anyway, libraries which are well written and which try not to be to intrudusive like yui or dojo simply do not have problems to be mixed with other libraries which follow the same design principles. It is just that some popular libraries (popular because of coming with certain frameworks or extending the language) basically do not care about all this, but simply follow the principle. We do what we want and simply do not care a shit if we break half of code of others!
And yes if you use prototype or jquery, never mix in both because they collide due to the same braindead approach to reserve something in their namespace which is the root namespace for both of them. They both collide because they want to rewrite the language by reserving their own operators. But this is a non issue in any other library which follows sane design principles instead of trying to invent its own language.
So mixing is possible and can be done, just not if you use prototype or jquery!
Where did you get that idea about jQuery. jQuery rigorously protects the global namespace, only adding functions to the $ variable. Even the $ variable can be reverted to its original use (if you’re using jQuery with Prototype), but running jQuery.noConflict().
What you’re saying is literally the *opposite* of what’s true about jQuery.
— Yehuda Katz
Author, jQuery in Action
I think the two represent two different aims.
Prototype is more the generic framework designed at smoothing out the differences between browsers. It is more a foundation library that lets you build your own app or framework on top of a level foundation.
jQuery is more the thinner front-end layer that’s designed to move things around the screen and simplify your coding. It’s better for doing special effects in web pages without trying to write a whole OS in JS (What Prototype+Scriptaculous feels like)
I though IBM was supporting Dojo. Funny he didn’t even bring it up once.
I made a new google trends request including Dojo. It seems like it was a clear winner, but it drastically drop in early 2008. I’m wondering if it’s the reputation of the 0.4 release or a deception for the 0.9 that contribute to this drop.
http://www.google.com/trends?q=dojo%2C+jquery%2C+mootools~*…
“As browser-based applications continue to replace desktop applications…”
Does this mean using a browser as the interface for a locally-run app, or as the interface for using an app run in this “cloud” that I have lately read so much about? This “cloud” idea is the most ridiculous idea I have read in quite a while and I expect it to end up as just another never-happened-in-the-real-world fantasy touted by people hoping to create and cash in on another dot com boom.
But are browser-based applications *really* “continuing to replace desktop applications”? Hard to believe. Unless, of course, the person who wrote this happens to have some hard numbers showing it.
I personally don’t know of anyone who does use such online applications. People like to have their files in their own hands, not on some unkown location only accessible through _their_ software. That’s also why corporates rather have a local copy of the oline application server than use an outside server over which they have no control.
I do have to say all this hype sounds very much like a bubble that sooner or later will burst. I know there are some people who do find such online apps useful, but I just don’t think such online services will ever reach the popularity of local applications.
Who said anything about an outside server beyond control? Web-based applications are really big in the corporate environment at the moment – HR/time-logging, expensing, training, work tracking, etc. In our office, all of that is handled completely online, all of them rich apps to some degree (not just classic form pages). They have the advantage of working on every desktop in the company – or remotely from home – without any software more than a basic desktop installation.
Same goes for more specialised apps, such as the one I code on for a living. The entire interface is web based – upgrading is simply a matter of updating the server, nothing needed client-side. For most corporate-use software, it’s a no-brainer doing everything web based.
its happening in small degrees. i work in a retail environment and several of our design and special ordering programs run in firefox using java. firefox is basically our thin client desktop. easy to deploy just upgrade the app on the server side and the clients immediately have access to the new apps. so it has its uses and is prob not going away. as for home desktop use doubt its going to seriously overthrow traditional apps. it seems more of a novelty. but ultra portable devices are another story where storage is a premium one could fire up google docs on their iphone/umpc/cloud/android/netbook gizmo and save it and access it later on another device or send it via gmail to a friend.
I’m glad I’m not the only one who doesn’t feel this assumed change. Beside webmails that have been around since the 90’s, what other applications are now more used on the web than locally? I yet have to see someone using Google Docs, a web-based multimedia player or a web-based photo editor instead of conventional desktop applications… Is this assumption that now people use webapps just a fantasm?
I yet have to see someone using Google Docs
I use it at work, it makes sharing documents amongst co-workers easy.
I don’t need (or have) a ‘desktop’ work processor at all.
a web-based multimedia player
Seriously? You don’t use YouTube? Internet Radio?
Agree with you. In 2000, I was using the web for email and online banking. In 2008, I am using the web for email and online banking, but have also added Google Maps to the mix. I do read some RSS feeds on the web (but that is more about browsing anyway), and that’s about all.
Except for a few other minuscule tasks, I don’t see web apps replacing my traditional desktop apps for at least another 20 years. The main problem here is that security is an issue when dealing with web apps, so anything that gets anywhere close to the hardware (such as burning/ripping DVDs) is going to be hard to pull off, lest you want to have another ActiveX nightmare on your hands.
Working in raw JavaScript is like working in assembler in the old days. Yeah, yeah, I know that the JavaScript library you wrote from hand is better than the libraries out there (aka. Not Invented Here syndrome).
Personally, I find that the JavaScript code generated by The Google Web Toolkit (GWT) is perfectly adequate for almost everything AJAX-y. You get to program in Java rather than assembler … eh, I mean raw JavaScript.
Try GWT, it will add years to you life and remove them from your development time
http://code.google.com/webtoolkit/
It is both gratis (doesn’t cost) and open source, so there is every reason for you to give it a look. Hope it helps you.
Ug. While I myself am not a web designer, designers I work with swear at GWT almost daily. As a web developer and release engineer I swear at it as well.
Also note it binds you to Java ;-).
Cool, thanks for sharing your experience. I suppose it depend on how comfortable you are with Java, as opposed to Javascript. It makes sense that your web designers struggle with GWT, since they’re designers rather than developers. So fair enough that GWT might not make sense for your shop 😉
True it binds you to Java on the server side. Given Java runs on a larger number of platforms than most of its competitors (eg. anywhere gcc/gcj is), is Open Source, has several alternative implementations and several large vendors behind it (Sun, IBM, Apple, GNU), runs very fast these days, integrates with other technologies on the back-end (JNI, network, etc), and has a huge ecosystem of tools etc then it makes better sense than Javascript for a few development shops (like mine).
How does Objective-J compare to this?
http://cappuccino.org/
They used this frame work to build this application:
http://www.280north.com/
I think it has more features that any other JS library out there.
not even JS they include other stuff for layout and css.
Edited 2008-09-10 22:24 UTC
I’ve read that these various JavaScript packages are NOT liked by many Javascript programmers. At least that is the impression I get from posts on
http://groups.google.com/group/comp.lang.javascript/topics
Ushering the end of the personal computer.