IE9 支持 HTML5 Canvas 标签

发布于 2024-10-17 16:01:38 字数 498 浏览 3 评论 0原文

我正在尝试测试画布标签,我从以下代码开始:

<html>
 <canvas id="example" width="200" height="200">
    This text is displayed if your browser does not support HTML5 Canvas.
 </canvas>
</html>

在 IE8 中,我收到消息:

 This text is displayed if your browser does not support HTML5 Canvas.

然后我安装了 IE9,但出现了相同的错误。 IE9 是否支持 HTML5 画布?

编辑

问题是我缺少 doctype 标签

<!DOCTYPE html>

I am trying to test out the canvas tag, I started with this code:

<html>
 <canvas id="example" width="200" height="200">
    This text is displayed if your browser does not support HTML5 Canvas.
 </canvas>
</html>

In IE8 I get the message:

 This text is displayed if your browser does not support HTML5 Canvas.

I then installed IE9 but get the same error. Does IE9 support HTML5 canvas or not?

Edit

The problem was that I was missing the doctype tag

<!DOCTYPE html>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

小红帽 2024-10-24 16:01:39

扩展 来自 gor 的答案,请确保您已添加以下元数据。

<meta http-equiv="X-UA-Compatible" content="IE=Edge"/>

这将迫使 IE 尽可能使用最新模式,用户无需从开发者工具更改兼容模式。

Extending the answer from gor, make sure that you have added following metadata.

<meta http-equiv="X-UA-Compatible" content="IE=Edge"/>

This will force IE to use the latest mode as possible and users don't need to change the compatibility mode from developer tools.

献世佛 2024-10-24 16:01:39

据我所知,IE9 的 HTML 5 Canvas 支持正在开发中,除非它已经在 RC 中。也许不是最好的网站,您可以浏览 html5test 使用 IE9 来查看它是否支持某些 HTML 5 标签。作为替代方案,您可以浏览 caniuse,它也会为您提供有关浏览器 HTML5 支持的大量信息。

As far as I'm aware HTML 5 Canvas support is under development for IE9, unless it is already in the RC.. Perhaps not the best website to find out you could browse to html5test with IE9 to see if it supports certain HTML 5 tags or not. As an alternative you can browse to caniuse which should also give you alot of info regarding the HTML5 support of browsers .

痕至 2024-10-24 16:01:39

只是补充一点,我一直在使用一个名为 excanvas 的小脚本,它允许我运行画布IE8 上的动画(缓慢),还没有在 7 和 6 上尝试过,但值得一看。

Just an add on to this there's a little script I've been using called excanvas that has allowed me to run canvas animations (slowly) on IE8, haven't tried it on 7 and 6 but it's worth a look.

雨落星ぅ辰 2024-10-24 16:01:39

如果您安装 Google Chrome Frame 插件 [http://www.google.com/chromeframe][1],它会升级 IE6-9 以运行 webkit 渲染引擎 - 以及 HTML5/CSS3 支持。

If you install the Google Chrome Frame Plugin [http://www.google.com/chromeframe][1], it upgrades IE6-9 to run the webkit rendering engine - along with HTML5/CSS3 support.

司马昭之心 2024-10-24 16:01:38

IE9确实支持画布。 这里是一个例子。

如果画布在您的浏览器中无法工作,请按 F12(打开开发人员工具),并确保 IE 未处于兼容模式。

IE9 does support canvas. Here is an exmaple.

If canvas does not work in your browser, press F12 (open developer tools), and make sure, that IE is not in compatibility mode.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文