views:

665

answers:

8

I am looking at the custom attributes feature of html 5 here at this link http://ejohn.org/blog/html-5-data-attributes/

This look like the perfect thing for when I am using jquery/javascript.

My question, Is HTML 5 supported by all the main browsers?

example

<li class="user" data-name="John Resig" data-city="Boston"
     data-lang="js" data-food="Bacon">
  <b>John says:</b> <span>Hello, how are you?</span>
</li>
A: 

no, not yet. wait at least until gecko and webkit support it.

ps: you could use html 5 with data attributes anyway, if you need it for javascript purposes. or choose some other unused attributes (title, abbr, ...others?)

dusoft
A: 

As of August 25, HTML 5 is still a working draft. http://dev.w3.org/html5/spec/Overview.html

ZippyV
I didn't downvote you, but this doesn't answer the question. Several HTML 5 features are supported in many of the major browsers -- regardless of the fact that HTML 5 is still officially only a working draft.
bigmattyh
Why would anyone create a website based on incomplete specifications? Unless it's for experimental purposes.
ZippyV
i think he was after getting custom attributes working and i offered a workaround instead of just copy pasting URL. more constructive approach, don't you think?
dusoft
Well reason #1 might be that the WHATWG has already said -- non-facetiously -- that they don't expect the final recommendation to be done until 2022 (http://blogs.techrepublic.com.com/programming-and-development/?p=718). Spec teams don't drive browser technology; they're only a part of the picture.
bigmattyh
...sigh. Please stop repeating the 2022 date. That's a rough estimate of when HTML5 will be read Recommendation status. This means that there are at least two *fully compliant* mainstream browsers implementing *every piece* of it.For reference, HTML4 (you know, that language we've been using for well over a decade?) isn't a Recommendation under the current rules, and probably can't ever be.HTML5 will be entering Last Call next month or so, and parts of it are stable and usable right now. Support will continue to improve over time. Two years from now I except support will be fine.
Xanthir
@ZippyV, more directly: there's no point in waiting for these working groups to finalize their specs when the technology becomes available in the real world. The Wireless-N spec has been in draft state for how long now? And features of CSS3 are now supported in 90% of the browser market. That's part of our job, to assess the current landscape and make use of what we can, know where the limitations and workarounds are, and deliver based upon that knowledge. We don't wait for some committee to allow us to proceed.
bigmattyh
@Xanthir: OF COURSE support for much of HTML5 features will be available in a significant share of the marketplace, far before 2022. I brought it up to illustrate that how silly it is to wait on the official finalization to start making use of the technology.
bigmattyh
I would at least wait until it's a candidate recommendation and there's good support from all the major browsers.
ZippyV
+1  A: 

Parts of HTML 5 are supported by the Safari, Firefox and Opera, but they are not necessarily incorporating the same parts.

It seems that Firefox is the most ahead, from my experience, but it will be years before the majority of browsers users use will support it.

So, until then we will need to continue trying to use it when we can, in browsers that support the new features, and having workarounds for users that haven't updated yet, or continue to use IE.

James Black
Don't know why the downvotes, but, wrt the data attributes, this should be included I would expect fairly soon, but the problem is that you will need to have a version of the javascript that uses these attributes and a version that doesn't, for years, and since John Resig is involved with FF I would expect them to move quickly to support it, closely followed by Opera.
James Black
A: 

HTML5 isn't even closed to completly support on any browser yet, and some browsers (Notable the IE's) have no intentions on supporting it at this time.

FlySwat
WTF is with the downvotes.
FlySwat
IE9 claims to.. http://blogs.zdnet.com/microsoft/?p=5572
John Isaacks
A: 

No.

The Wikipedia page "Comparison of layout engines (HTML 5)" does a good job of listing which engines have implemented which parts of HTML5.

There is currently a lot of red boxes on those tables, and that is based on the latest development version, not the version most users will be using.

dbr
A: 

Full support of HTML 5 is a way off BUT...

Creating custom attributes is nothing new and is likely to work in all the main browsers - but test to be sure that it will work in your case.

We can use HTML 5 now, just not all of it. A lot of HTML 5 is about formalising the way that HTML is currently used and ensuring backwards compatibility - so if a feature works in browsers now, use it.

edeverett
+8  A: 

Various portions of HTML5 are supported by the different browsers, for various definitions of 'supported'.

Several parts work right now, reliably. The data-* attributes you ask about in your question work just fine in every browser, even IE6; however, nobody yet supports the fun "dataset" method to access them. As long as you're fine with just grabbing them by the full attr name, you're golden. I use them to store state all the time in my webapps, as they're the officially blessed method for doing so.

Wikipedia has a good summary of the various support levels across browsers: http://en.wikipedia.org/wiki/Comparison_of_layout_engines_(HTML_5)

Xanthir
I'd imagine using attributes like that would fail XHTML validation though.
FlySwat
I think the XHTML schema is extensible.
ChrisW
If you're using HTML5, you wouldn't be validating against XHTML anyway.
bigmattyh
@FlySwat No, they'll validate just fine as XHTML5.
Alohci
A: 

Almost no web technology is completely supported by any browser; no bugs, quirks or issues.

HTML5 is designed for backwards compatibility, and it will hardly break your site (take <input type=url> for instance - non-supporting browsers show an ordinary text box, Opera lets you select an URL from history/bookmarks). I'd go by the approach: develop, try in the browsers you need to support - if it works, awesome. If not, don't use it. Just like with other specs.

Jacob R