Comments on: JQuery Fun http://www.terminally-incoherent.com/blog/2008/03/19/jquery-fun/ I will not fix your computer. Tue, 04 Aug 2020 22:34:33 +0000 hourly 1 https://wordpress.org/?v=4.7.26 By: Luke Maciak http://www.terminally-incoherent.com/blog/2008/03/19/jquery-fun/#comment-8554 Wed, 19 Mar 2008 19:59:08 +0000 http://www.terminally-incoherent.com/blog/2008/03/19/jquery-fun/#comment-8554

Yeah, I had a run in with dojo at one point, but I remember it was big and confusing mess. At least that was my first impression, and I didn’t really work with it long enough to fully appreciate it.

I also saw some really cool stuff being done with prototype but I never actually used it.

I kinda fell in love with JQuery because it was so tiny/simple, and yet could do most of the things her bigger brothers and sisters were capable of. :)

Reply  |  Quote
]]>
By: Adam Kahtava http://www.terminally-incoherent.com/blog/2008/03/19/jquery-fun/#comment-8553 Wed, 19 Mar 2008 19:35:14 +0000 http://www.terminally-incoherent.com/blog/2008/03/19/jquery-fun/#comment-8553

Many of the other JavaScript libraries (YUI, Scriptaculous, even the ASP.NET AJAX Client Side libraries) offer capabilities almost identical to JQuery. Scriptaculous / Prototype is probably closest to JQuery. The nice thing about these JavaScript libraries is that they’re cross platform compatible, and built around the Event Driven Programming Model – so they really force you to think differently.

Reply  |  Quote
]]>
By: Luke Maciak http://www.terminally-incoherent.com/blog/2008/03/19/jquery-fun/#comment-8552 Wed, 19 Mar 2008 19:24:05 +0000 http://www.terminally-incoherent.com/blog/2008/03/19/jquery-fun/#comment-8552

Hey, I actually didn’t think about that. Good one! Still, JQuery code remains slightly more readable.

I could do something like this:

$(document).ready(function() {
    $("#nice > a:even").click(function() {
        // on click code goes here
    });
});

This would only add the on-click function to the even numbered link inside a container with the id of nice which would probably require more code in your example. :mrgreen:

Reply  |  Quote
]]>
By: Adam Kahtava http://www.terminally-incoherent.com/blog/2008/03/19/jquery-fun/#comment-8551 Wed, 19 Mar 2008 18:48:18 +0000 http://www.terminally-incoherent.com/blog/2008/03/19/jquery-fun/#comment-8551

To make things even more fun… :)

In the first example you could have listened to a container object like the window.onclick, then filtered out the event type, this could have probably distilled your first example into something similar to your later example.

Something like:

window.onclick = function onClickFunction(myEvent){
if(myEvent.target === ‘A’){
// the on click code goes here
}
}

Reply  |  Quote
]]>