So there has been a lot of buzz about
JQuery lately. I've heard it from several people including coworkers and
Scott Hinselman's blog. At first, I didn't really think too much about because I just didn't have the time. But after further review, this piece of javascript zen is too fabulous. Although, with anything this great, I found myself going through the 5 states of emotional recovery.
Step #1: Curiosity
So everyone is talking about it. It must be good and I'm like curious george the capricorn, so I'll just take it for a spin and see if it's worth the extra bits flying across the internet. I'm always looking for something new to throw into the ole repository of code snippets I've found across the years. Of course, curiosity killed the cat.
Step #2: Denial
I have
almost always used my own javascript for anything and everything. I like to think it's good, but I now feel like I know nothing about javascript. I feel like I need the javascript equivalent of "The C++ Programming Language". It's not that I can't read it, rather I just can't believe the breadth of what I am reading. Someone has some serious understanding of both javascript, the DOM, css, events, etc, etc. Bravo for you, but now I pity myself.
Step #3: Anger
Why Didn't I have this years ago? Why didn't I write this? I probably wouldn't have shared it anyway! I would have coveted it like a child. I could have just used all my code snippets again and again in the same ole bloated fashion. I don't need this, it's too much to learn. It has too many moving parts. I hate moving parts cause it generally means I have to work on it at some point.
Step #4: Confusion
How do I do this and that? How did it do this and that? What made this work but not that? Can't I just do this? That didn't work... Why? Ok, look at the source again. Search. ok. Now how in the $#%@! ok. That's something new. I'll try to remember that tomorrow after I get this to work. Now where did that come from? I am confused.
Step #4.5: Bargaining/Depression
Insert more code reading and searching and trying to extend it so I now have a stronger knowledge of javascript. There are still pages of code I haven't even needed to see yet. I am tired and blurry eyed. I'll just look at more tomorrow if I can just figure out what I need to do now.
Step #5: Acceptance
I can't believe it does this. This is fabulously cool. I will insert this reference into every page I write from now on. The power of it is immense. I love the how it selects everything and applies what I want so quickly and it uses the same notation that I am familiar with - CSS AND XPATH! I am happy and efficient now. So many lines of code in one single line. Clean html... mmmmm...
Ok, so there you have it. If you haven't checked it out, you should. I will say there are lots of examples out there, if you can find them. I still have more code to read, but I am at least excited about what I am doing. It was one of those days where you look at the clock and your late again. sweet. I'll see if I can get some of my own examples up!