开发者

Can I use jQuery with HTML5? [duplicate]

开发者 https://www.devze.com 2023-01-22 08:23 出处:网络
This question already has answers here: Closed 12 years ago. Possible Duplicate: What browsers support HTML 5 / CSS3
This question already has answers here: Closed 12 years ago.

Possible Duplicate:

What browsers support HTML 5 / CSS3

I keep hearing about HTML5. If I start learning it and using it, will I have any browser compatibility issues?

I use jQuery considerably. Has it been upgraded to be compatible with HTML5? Basically, is it saf开发者_StackOverflowe to use HTML5 now, or better to wait?


HTML5 is a collection of different features that are each being adopted by the different browsers at different paces. So whether its worth using now depends on which feature you are interested in using and which browsers you need to support.

The question that Pekka linked to references a number of sites that will give you an idea of which features are supported in which browsers.

Also take a look at http://diveintohtml5.ep.io/ for more background.

UPDATE: I don't see any reason not to use jQuery with HTML5 where appropriate. The JavaScript examples in http://pragprog.com/titles/bhh5/html5-and-css3 use jQuery.


This answer claims that jQuery works fine with HTML5, but it doesn’t include (and I haven’t been able to find) any references in support.

jQuery should generally work fine with HTML5, as HTML5, as far as possible, is based on existing browser behaviour. Not sure if there would be any issues in older browsers though.

E.g. IE 6 doesn’t handle new HTML5 elements (like <article> and <section>) properly without some JavaScript help. One assumes jQuery plays nice with this, but I don’t actually know. See e.g. jQuery, html5, append()/appendTo() and IE for a possible issue.


jquery works the same in HTML5 documents as it does in HTML4.01 documents. There is no difference at all until jquery starts using HTML5 elements.


You'll have issues with IE and old versions of FF, Safari, etc...

0

精彩评论

暂无评论...
验证码 换一张
取 消