3
我有问题让webshims插件画布polyfill工作。webshim polyfill画布将无法在IE7模式下工作
我收到以下错误IE9使用IE7模式:
SCRIPT438: Object doesn't support property or method 'fillRect'
problem.html, line 21 character 7
当我尝试运行此代码:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>DealingTree</title>
<meta http-equiv="Content-type" content="text/html;charset=utf-8"/>
<script type="text/javascript" src="/js/modernizr.js"> </script>
<script type="text/javascript" src="/js/jquery.js"> </script>
<script type="text/javascript" src="/js/sssl.js"> </script>
<script type="text/javascript" src="/js/webshims/js-webshim/minified/polyfiller.js"> </script>
</head>
<body>
<canvas id="savings" height="350" width="700"> </canvas>
<script type="text/javascript">
//<![CDATA[
window.FlashCanvasOptions = { disableContextMenu: true };
$.webshims.setOptions('canvas', { type: 'flashpro' });
$.webshims.polyfill('canvas');
var canvas = $('#savings');
var context = canvas.getContext('2d');
context.fillStyle='#F00';
context.fillRect(0,0,700,350);
//]>
</script>
</body>
</html>
的问题发生了,我是否使用默认的(excanvas)或的FlashPro 。
更新:在我看来,getContext()返回一个jQuery对象而不是上下文。
请帮忙吗?
这里的该插件的主页: http://afarkas.github.com/webshim/demos/index.html – 2011-05-20 15:36:39