Open main menu
Home
Random
Log in
Settings
About Sugar Labs
Disclaimers
Sugar Labs
Search
Changes
← Older edit
Karma/Anti-conventions
(view source)
Revision as of 08:22, 18 January 2010
15 bytes removed
,
08:22, 18 January 2010
→Putting style information inline
Line 20:
Line 20:
.text('hello world');
.text('hello world');
−
According to jQuery Cookbook this is much, much faster
+
According to jQuery Cookbook this is much, much faster
<nowiki>
<nowiki>
$parent = $('#someId').append($('<div id="foo" class="foobar baz">Hello World</div>'));
$parent = $('#someId').append($('<div id="foo" class="foobar baz">Hello World</div>'));
</nowiki>
</nowiki>
−
FYI, prefixing cached jQuery reference w/ a "$" is a good practice.
+
FYI, prefixing cached jQuery reference w/ a "$" is a good practice.
−
==Putting style information inline==
==Putting style information inline==
<nowiki>
<nowiki>
Line 32:
Line 31:
</nowiki>
</nowiki>
−
This makes the lesson much harder to debug as you have to look both in the .css file
+
This makes the lesson much harder to debug as you have to look both in the .css file
−
and at the html. As the lesson grows, which it will, it gets harder and harder to
+
and at the html. As the lesson grows, which it will, it gets harder and harder to
−
pin down small bugs
+
pin down small bugs
==Mixing naming conventions, like camelCase and not_camel_case==
==Mixing naming conventions, like camelCase and not_camel_case==
BryanWB
359
edits