html5 Archive

Introducing HTML’s new template element

You may have heard of Web Components, a suite of emerging standards that make it possible to build secure reusable widgets using web platform technologies. One of the first specs to make its way into implementation is HTML Templates, embodied by the template element, which as I write this is implemented in Chrome Canary and Firefox Nightly.

Read the full article


Primum non nocere

The Latin phrase used in the title of this post, primum non nocere, translates as:

First do no harm.

It’s often said that this is part of the Hippocratic Oath, from the code of ethics followed by medical professionals. While that’s not correct, it’s a rule that’s generally considered important to follow: do good, or at least do no harm.

Although what we do is not as critical to society as the role of a doctor, I think we need to start considering an oath like this for working on the web. Let me explain why.

This week I’ve seen two ‘HTML5’ websites which feature rich interactions and animations; like Flash used to be, but now using open web technologies. This is a very good thing. However, visit them with JavaScript disabled and you get a very different experience: that is, nothing, or next-to-nothing. Literally. On one site I saw a logo and a message telling me I needed JavaScript; on the other, a blank screen.

If all of your content is in HTML, and styled with CSS, but you’re requiring people to use JavaScript before they can see it: you’re doing it wrong.

In order to ensure that we make websites available to everyone, regardless of browser type or capability, I would suggest we come up with our own oath – perhaps something like this:

First make your content accessible.

This isn’t new, of course; this is basic stuff. But so keen are many of us to rush to take advantage of all the shiny newness of devices and features, we’re forgetting to do the fundamentals. We’re doing harm.


Styling HTML5 Form Validation Errors

Back in March I wrote about HTML5 Form validation and the problem with the appearance of error messages. I proposed a syntax for styling the error messages, and shortly after I published the post, I submitted the proposal to the W3C via the www-style mailing list.

I’ll discuss quickly the result of that submission, but first I should mention that I’ve since found out that the Google Chrome developers have already implemented their own syntax, and it’s not too far removed from what I proposed. Before I get to that, however, allow me to gripe.

Read the full article


HTML5 Form Validation

A lot of the attention paid to HTML5 Forms has been centred around the new input types. email, url, date, and the rest are all very convenient, but for me the really useful feature is the built-in validation. In case you’re not aware of it, the browser will now handle all of the validation that we used to use JavaScript for.

This is great for the future, but although you can start using these functions now (in many browsers), they aren’t without their drawbacks – well, one big drawback really. I’m going to explain briefly the problem, and then propose a solution.

Read the full article


HTML5 for Web Developers

The WHATWG have released the HTML5 Edition for Web Developers, which removes all of the overly-technical details aimed at browser makers and leaves the important stuff you need to learn – and with a nice readable stylesheet applied.


Data Attributes in HTML and jQuery

Sometimes the existing HTML attributes aren’t sufficient for describing an element’s content. We can use class, ref, rel, title and more, but even so there are occasions where that’s not enough. HTML5 addresses this problem with the introduction of Data Attributes, which allow you to add simple metadata to individual elements, largely for the purpose of providing information to make JavaScript functions easier.

Read the full article


Older

Aside

I’ve updated my Speaking page to include more conferences, more videos, and a little on my speaking requirements and preferences. I’m planning to cut down on the number of talks I give in 2014 (twelve is too many), but am always open to interesting offers and opportunities, so please get in touch if you’re organising an event.

[#] 1 Comment . More Asides.