HTML and CSS Reference
In-Depth Information
various third-party plug-ins, like Flash or Java. By removing the need for
JavaScript and plug-ins, you can make your pages work on a wider variety of
devices and for a wider variety of users. You may also make your
development process quicker and more e ! cient, since you don't have to
take the time to find the right script or plug-in and get it all set up. Finally,
these techniques may be able to boost the speed of your pages, since extra
files don't have to be downloaded by the users. (On the other hand, some
may decrease performance, if the built-in browser version is slower than a
third-party version. We'll have to wait and see how browsers handle each
option now and in the future.)
Some of the features that reduce JavaScript and plug-in dependence are:
New form elements and attributes. HTML5 o " ers a bunch of new
input types, such as email , url , and date , that come with built-in
client-side validation without the need for JavaScript. There are also
many new form attributes that can accomplish what JavaScript used to
be required for, like placeholder to add suggestive placeholder text
to a field or autofocus to make the browser jump to a field. The new
input types degrade to regular inputs in browsers that don't support
them, and the new attributes are just ignored, so it doesn't hurt
unsupporting browsers to start using them now.
Of course, you'll have to put in fallback JavaScript for unsupporting
browsers, negating the “no JavaScript” benefits for the time being. (Or,
depend on server-side validation—which you always ought to have in
place as a backup behind client-side validation anyway—to catch the
submissions from unsupporting browsers.) Still, they o " er a nice
usability boost for users with the most up to date browsers, so they're
good for progressive enhancement.
Search WWH ::




Custom Search