我可以在HTML5中使用jQuery吗? [重复]

时间:2021-12-17 18:59:52

Possible Duplicate:
What browsers support HTML 5 / CSS3

可能重复:哪些浏览器支持HTML 5 / CSS3

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

我一直听说HTML5。如果我开始学习并使用它,我是否会遇到任何浏览器兼容性问题?

I use jQuery considerably. Has it been upgraded to be compatible with HTML5? Basically, is it safe to use HTML5 now, or better to wait?

我大大使用jQuery。它是否已升级为与HTML5兼容?基本上,现在使用HTML5是安全的,还是更好等待?

4 个解决方案

#1


3  

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.

HTML5是不同功能的集合,每个功能都由不同浏览器以不同的速度采用。因此,现在是否值得使用取决于您感兴趣使用哪种功能以及您需要支持哪些浏览器。

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.

Pekka链接的问题引用了许多网站,可以让您了解哪些浏览器支持哪些功能。

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

另请查看http://diveintohtml5.ep.io/以获取更多背景信息。

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.

更新:我认为没有任何理由不在适当的情况下使用HTML5和HTML5。 http://pragprog.com/titles/bhh5/html5-and-css3中的JavaScript示例使用jQuery。

#2


2  

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可以正常使用HTML5,但它不包含(我也找不到)支持中的任何引用。

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.

jQuery通常应该可以与HTML5一起使用,因为HTML5尽可能基于现有的浏览器行为。不确定旧版浏览器是否会出现任何问题。

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.

例如。如果没有JavaScript帮助,IE 6无法正确处理新的HTML5元素(如

)。一个假设jQuery对此很好,但我实际上并不知道。参见例如jQuery,html5,append()/ appendTo()和IE可能存在的问题。

#3


1  

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.

jquery在HTML5文档中的工作方式与在HTML4.01文档中的工作方式相同。在jquery开始使用HTML5元素之前完全没有区别。

#4


0  

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

你会遇到IE和旧版FF,Safari等问题......

#1


3  

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.

HTML5是不同功能的集合,每个功能都由不同浏览器以不同的速度采用。因此,现在是否值得使用取决于您感兴趣使用哪种功能以及您需要支持哪些浏览器。

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.

Pekka链接的问题引用了许多网站,可以让您了解哪些浏览器支持哪些功能。

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

另请查看http://diveintohtml5.ep.io/以获取更多背景信息。

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.

更新:我认为没有任何理由不在适当的情况下使用HTML5和HTML5。 http://pragprog.com/titles/bhh5/html5-and-css3中的JavaScript示例使用jQuery。

#2


2  

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可以正常使用HTML5,但它不包含(我也找不到)支持中的任何引用。

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.

jQuery通常应该可以与HTML5一起使用,因为HTML5尽可能基于现有的浏览器行为。不确定旧版浏览器是否会出现任何问题。

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.

例如。如果没有JavaScript帮助,IE 6无法正确处理新的HTML5元素(如

)。一个假设jQuery对此很好,但我实际上并不知道。参见例如jQuery,html5,append()/ appendTo()和IE可能存在的问题。

#3


1  

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.

jquery在HTML5文档中的工作方式与在HTML4.01文档中的工作方式相同。在jquery开始使用HTML5元素之前完全没有区别。

#4


0  

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

你会遇到IE和旧版FF,Safari等问题......