August 2007


Just thought I’d give everyone a shot to request any more features for Impromptu? Currently on my list is to make the options more global so you don’t have to declare your custom show method everytime.. unless thats what makes you happy :). So with this next release you might say something like…

$.ImpromptuOptions = { show: ‘mycustomeffect’, prefix: ‘myprompt’ };

Now you can just $.prompt() with just a message. Again this wont be required and may not be the exact syntax, but this is what I’m shooting for along with being completely backwards compatible. I wont be releasing this one for a while yet to try and get some feedback. So what do you think??

Finally a new version of jQuery Impromptu has been released. This release in my opinion has a few new cool features. First off you can now control the speed of the fade and the prompt box. Also you can now set which jQuery effect to use to bring in the prompt(show, fadeIn, slideDown, or your own custom effect).

Now to the good stuff. Now you can have a submit function. Just as you have form.submit(), you now can have the same function which operates about the same. You can validate your fields and determine whether to proceed sending the data and closing the prompt or not(returning true or false accordingly). Then you will still have your separate callback to be called after the prompt completely closes.

I hope this is of some use to someone, I know I’ve already used it several times!  There are examples of these new features on the Impromptu site.

In my very own opinion jQuery and Prototype are the two best options when developing with javascript. When asked which one should one use generally my first question is “What are you using it for?”. Each library definitely has its strenghts.

From what I’ve observed Prototype is going to work better for advanced algorithms or even eye-popping effects(these “eye-popping” effects have pretty complex algorithms within them :). Prototype’s string and array helper functions really improve what you can do with these objects, and hence make life much easier when computing. Unfortunately for any effects at all you will need another library to accompany Prototype.
Then we have the site where we need maybe just a couple smooth effects and maybe some Dom traversal. Well jQuery has that built right in with fading, sliding, etc. With xpath and css selectors traversing the dom(or an xml feed) has never been easier. I find this the fun part when I can grab a collection of elements which meet my xpath query. This librarly may not make complex algorithms quite as simple, which in my opinion is why there are no good Graph plugins out there as Prototype has. Hopefully there will be some good one’s on the way soon.
Then we have that area in the middle where jQuery and Prototype collide. Both of course like the $() function, however it’s not required by jQuery and they can both run together. Both have the nice each() iterator for loop through objects and such. And Prototype has the ubeatable Form object and $F(), which lets you handle forms in your sleep. But not to be out-done jQuery selectors can do whatever Prototype’s $F() can do in just a couple lines.

Ok, so we see a slight unfair advantage to Prototype so far, but we haven’t weighed in our contestants. Prototype weighs in at 120kb uncompressed. jQuery weighs in at 61kb uncompressed, and an astonishing 20kb compressed.(not counting plugins for either one) So there we have it, for quick, sturdy traversal and easy effects, I take jQuery, but for heavy computing and possibly heavy form processing and eye-popping effects, might want to take the heavy-weight Prototype and it’s buddies for effects. So there you have it, my take on jQuery Vs. Prototype.. And I ask again “What are you using it for?”.