8. The web is not a
closed environment
where we can
dictate the
technologies people
use.
9. Some of the things I
will talk about
today will seem
outdated or overly
cautious.
10. The reason is that I
want to build a web
that works.
11. For far too long we
have built a mess
that barely
functions and is
hard to change.
12. So here are a few
ideas and concepts
you should follow if
you write
JavaScript.
13. ★ Using, not abusing libraries
★ Separation of concerns
★ Building for extensibility
★ Documenting your work
★ Planning for performance
★ Avoiding double maintenance
★ Live code vs. development code
29. ★ Using, not abusing libraries
★ Separation of concerns
★ Building for extensibility
★ Documenting your work
★ Planning for performance
★ Avoiding double maintenance
★ Live code vs. development code
48. ★ Using, not abusing libraries
★ Separation of concerns
★ Building for extensibility
★ Documenting your work
★ Planning for performance
★ Avoiding double maintenance
★ Live code vs. development code
56. This allows people
who want to extend
your solution to do
so without having
to touch the main
code.
57. Don’t limit anything
to a fixed size or
amount. Instead
make it a variable in
the configuration
object.
58. ★ Using, not abusing libraries
★ Separation of concerns
★ Building for extensibility
★ Documenting your work
★ Planning for performance
★ Avoiding double maintenance
★ Live code vs. development code
70. ★ Using, not abusing libraries
★ Separation of concerns
★ Building for extensibility
★ Documenting your work
★ Planning for performance
★ Avoiding double maintenance
★ Live code vs. development code
71. You can find a lot of
great performance
tricks on the web
when it comes to
JS.
84. Make your code
easy to understand
and clean and add a
performance review
and refactoring step
at the end.
85. ★ Using, not abusing libraries
★ Separation of concerns
★ Building for extensibility
★ Documenting your work
★ Planning for performance
★ Avoiding double maintenance
★ Live code vs. development code
120. On submission of the form
load the validate.php file
with the config and don’t
send off the form.
Load the IO and Node
module.
Define the configuration
for the Ajax call.
121. If the Ajax call was a
success, replace the
innerHTML of the form with
the HTML returned from
validate.php
122. In addition to that, focus
on the first element with an
error message - this helps
with assistive technology.
132. ★ Using, not abusing libraries
★ Separation of concerns
★ Building for extensibility
★ Documenting your work
★ Planning for performance
★ Avoiding double maintenance
★ Live code vs. development code
144. Using JS to load the
fonts on the other
hand does.
146. Classes added to the root element
by the Google WebFont loader
.wf-inactive
.wf-active
.wf-tangerine-n4-inactive
.wf-tangerine-n7-active
.wf-droidsans-n4-inactive
[...]
n4 - normal i4 - italic
n7 - bold i7 - bold italic
http://code.google.com/apis/webfonts/docs/webfont_loader.html