So let??™s take
a look back over the decisions made during the implementation of the help sidebar and
examine the advantage of each in more detail.
Begin with a Solid Base of Semantic HTML
JavaScript gives you almost ultimate power to manipulate the look, feel, and behavior of
HTML elements, which often leads to JavaScript programmers diving straight in to scripting,
writing HTML to support their script. However, if you start by thinking how to best represent
the information on the page with static HTML you can take advantage of the built-in behaviors
that the browser gives you, enabling you to write less code as well as ensuring that the
application works as well as possible for users without JavaScript.
As a general rule, it??™s always advisable to start out by making a working version of your
feature with static HTML. Don??™t worry so much about this being usable or slick. Just make it
work and make sure that you put as much semantic value into the HTML as possible because
the richer your content is from a semantic point of view, the more hooks you??™ll have available
to you for your script.
In this chapter, you made sure that the static HTML version was working before even
starting to write JavaScript at all. This provides a very solid foundation to build on top of,
which ensures that the help content is accessible, search-engine indexable, printable, and
bookmarkable. Once this is in place you can go about writing the JavaScript as an enhancement
to this already fully operational feature.
Pages:
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287