Javascript Validation: Don't use WITH keyword
because the javascript engine has to do a lot of work to interpret what you mean.
So don't use
{
Instead use:
if( f.userEmail.value.length == 0 )...
I am considering dropping AjaxRequest (which is excellent) and switching over to prototype.js for the comments part of this site (I will be loading both the comments and comment posts via Ajax).
Shit. I search and searched and can't see if prototype.js supports easy submitting of form data via Ajax like AjaxRequest does. You see I'm a lazy developer and like my frameworks to do this sort of form serialisation grudge-work for me. Hmmm... to use AjaxRequest which has easy form submission via Ajax or to oppose and suffer the slings and arrows of prototype.js making me do it for myself. I could use both but AjaxRequest is 9K and prototype.js is 46K and I'd rather stick with one. Decisions, decisions.
Ok ok, I thoroughly examined prototype.js Ajax abilities and actually posting form data is absolutely simple. And so the winner is... prototype.js.
This Prototype javascript library that everybody is talking about looks to be fantastic but where the hell is the documentation? I mean apart from the Sitepoint article and a few others theres no official documentation (or even a promise of documentation en-route)!
I've just done a big of digging and have just found that Sergio Pereira has just written "Developer Notes for Prototype.js" which is an excellent introduction to the prototype library. In his notes, I found a good overview of the main reason I am thinking about using prototype.js at the moment - it's easy-to-use but powerful Ajax framework.
I have to say I am very impressed with the Ajax.Updater class which will just shunt a bit of HTML returned from the server into place on your existing page with almost no developer effect:
var myAjax = new Ajax.Updater( 'placeholder', url, { method: 'get', parameters: pars
});
I like it!!
Peter Coppinger aka Topper is a neurotic web monster who spends most of his chaotic life developing ColdFusion web applications when not drinking himself into a stupor and scheming his plans for world dominance.