CHAPTER 3 The Vanilla Web Diet
to get a context menu full of useful functionality like “Bookmark”, “Save as”
or “Open in a new tab”. None of these make sense if the URL is #, do they?
Forms have come a long way, too. A simple required attribute on an
input element means the user cannot submit the form until that data
has been entered. Adding a pattern attribute allows you to define a rule
in the form of a regular expression. In the past, all of this required a lot of
JavaScript — now it is in browsers by default.
We’ll discuss more examples like this as the chapter progresses. For
now, keep your eyes open and look at what HTML5 has to offer you, with-
out the knee-jerk reaction of saying a particular feature doesn’t work in
your favorite browser. We are building for a new set of conditions and for
people who do not share our developer pain. Having a rich vocabulary is a
wonderful thing. We should not only be Web-literate, we should be mark-
up poets.
Lack of Support is an Opportunity
If an old browser cannot do something, we have the chance to test for it and not
provide that functionality. In most cases, the functionality is merely nice to have
and isn’t needed.
One big mistake we made in the past, and which we keep carrying
forward, is giving standardized and highly demanding code to non-stan-
dard and outdated technology. Yes, this is about OldIE, as we like to call it,
but also concerns the new problem child browsers: stock browsers of older
versions of Android and iOS.
As creators of the Web we have two duties. First, we have to deliver a
working interface which should be exciting and a joy to use. Enjoyment
is a worthwhile goal, but the most important part is the working bit. Our
second duty is to use what browser makers give us to make the results
of fulfilling the first duty as amazing as possible, and as maintainable as
possible for the people we hand our code over to.