Search:
Calendar:
| Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | |
| 7 | 8 | 9 | 10 | 11 | 12 | 13 |
| 14 | 15 | 16 | 17 | 18 | 19 | 20 |
| 21 | 22 | 23 | 24 | 25 | 26 | 27 |
| 28 | 29 | 30 | 31 |
Subscribe:
Archives By Subject:
Adobe (33) [RSS]
AIR (7) [RSS]
Ajax (3) [RSS]
Buzzword (1) [RSS]
CFUG (42) [RSS]
ColdFusion (70) [RSS]
Flash (6) [RSS]
Flex (40) [RSS]
Frameworks (3) [RSS]
Free Software (2) [RSS]
FXUG (22) [RSS]
General (35) [RSS]
JpgMetadataReader (3) [RSS]
jQuery (1) [RSS]
Mac (2) [RSS]
Off Topic (13) [RSS]
OpenSource (14) [RSS]
PaperVision (10) [RSS]
Spry (2) [RSS]
Transfer (1) [RSS]
Tags:
Recent Entries:
Top Posts:
- [18084] Paper Vision 3D Sphere - Carousels on Steroids!
- [10016] Simple Dynamic Cursor Example in Flex2: With source code
- [9848] Simple PaperVision3D Blurring example
- [9693] PaperVision3D/Flex2 Carousel v0.2
- [9652] Simple PaperVision3D Blurring example : source code
- [9550] Saving images from Flex using ColdFusion: Simple Example with source code
- [9530] Carousel v0.2 - source code
- [9232] PaperVision Carousel0.3 - one step closer to the master plan!
- [7865] PaperVision3D is good for cubes! - a "geek" gift
- [6835] Simple Effects on a Form - Flex Example
Recent Comments:
- Getting Red from my color
David said: @Promethe: Thanks for the comment. Jason uses that way too in his example. working with number as n... [More] - Getting Red from my color
Promethe said: guys... seriously: var myColor : uint = 0xef556ef; var myRed : uint = (myColor >> 16) & ... [More] - Getting Red from my color
David said: @Jason: Thanks for the example! I never like working with numbers-to-strings-to-numbers. I'll pull y... [More] - Getting Red from my color
jason olmsted said: There is always more than one way to skin a cat. I threw together a quick class that offers easy to... [More] - Frameworks: Whats good about them, whats bad about them.
Arowolo said: I totally agree with you, and to add to your point, i think it also reduces ones understanding of th... [More]
Top Commenters:
- [8] Campbell
- [8] Ben Nadel
- [6] Steve Bryant
- [6] Mark Flewellen
- [4] barry.b
- [4] Raymond Camden
- [3] John Whish
- [3] Peter Bell
- [2] riabook
- [2] carlos
My Links:
RSS:
Adventures in jQuery
The last week or so I've had the pleasure of working deeply with jQuery.
And I mean that, it's been a pleasure.
Once you get used to the 'style' of how it works, it makes sense and has a consistent coding experience.
I've worked mainly with the core and the ui.jquery libraries, with fileupload thrown in.
In the mix is also
I've got jQuery adding and removing custom DOM elements on the fly, while updating information on the server, uploading and deleting images and also maintaining the structure of the form so that when it is submitted in the usual "post" manner, the server knows what to do with the data it receives.
So all in all I've had a good experience with it.
Things it has helped me understand is the use of "anonymous Functions" (I think that is what they are called)
EG:
now the "hide" method will accept an argument of a function that it will call when it has completed. Commonly called a "callback", so i we had a function like this:
To use an anonymous function to do the same thing, this is what you would do:
You can also do this in Flex.
eg:
rather than:
One thing that works, but somehow feels wrong, is that the anonymous functions have direct access to the variables declared in the calling function.
eg:
{
var someString = "bob";
$("#myelement").hide( function(){ alert( someString ); } );
}
So all in all I've enjoyed getting to know jQuery, and suspect it's the beginning of a beautiful friendship!
...but, I still prefer Flex!

jQueryObject
. . . . .attr()
. . . . .attr()
. . . . .attr()
;
(the extra periods (.) are just for spacing. They are supposed to be tabs.
Also, the headless function was a bit more tricky:
jQueryObject.click(
. . . . function(){
. . . . . . . . var jThis = $( this );
. . . . . . . . return( something );
. . . . }
. . . . );
Once I figured out that stuff, it made me much more comfortable.
I too have a coding style that works for me.
Laying out the code in a consistent manner sure helps readability!
One thing I don't like about lots of white space is the weight in size it can introduce to my JS files.
...so that's why I've been so interested in the 'combine' project @ RIA forge (http://combine.riaforge.org/)
I downloaded the raw jQuery and ran "combine" over it and the resulting JS file was almost identical to the minified jQuery package. I guess this shouldn't be a surprise since I think it uses the same jsMin to do it ;-)
What's great about this is that I can write my verbose, nicely layed out JS and then reduce it's size of my site user on the fly.
The "combine" project is still Alpha, but Joe has been very active on it, So keep an eye on it!
Cheers,
David
Good point. White space does add overhead unlike in a ColdFusion file which is compiled on the server.
I used to keep two versions of each .js file, one minified for production, and the other for development. I experimented with minifying the javascript during the build process, but opted for doing it at runtime as this offers the added advantage of reducing the number of http requests.
"...but, I still prefer Flex!"
So do I :)