Honestly, I think you have a good understanding. Some of my freezes were similar. The way I am advancing is "good, if so, as it is, then so it is." Just accept the features and plow ahead. PHP does some of the same things (variables can appear out of nowhere, etc.). Just enter the code you want to encode, and if it works, then great!
Then, after you get to this point, start tearing down the profiler and see if there is anything that you can optimize.
Here are a few things:
If you understand CSS, then jQuery selectors should be easy. As for the code, it's easy if you can deal with chaining and JSON. EDIT: also, the jQuery documentation about everything will be GREAT! And there is no shortage of jQuery experts in SO to help us noobs (and hopefully we can return the benefit to the new noob).
There is an opportunity to work. (Basically) everything written outside a function or object is on a global scale. If you are inside an object or function and use var , this sets the scope of the variable
Javascript is not like C-language (C ++ or even PHP). It uses prototypes to handle relationships between classes and objects, rather than subclass schemes.
The # 1 that threw me for the loop is that any JS that appears anywhere on the page or that has been included in the <script> tags is an honest game. If you have a global variable in one script, you can use the same variable in a completely different script, and it will work. This may be what you mean by variables that appear out of nowhere. In addition, there are some DOM variables that can simply be "mapped".
In any case, I think that if you just plow ahead, you will get a few “AHA” moments. I am a relative noob for programming, but I am constantly growing until I depend on something that does not have a big impact on the actual execution of the code.
Tim Aug 03 '10 at 16:00 2010-08-03 16:00
source share