简体   繁体   English

excanvas IE8,对方法或属性访问的意外调用

[英]excanvas IE8, Unexpected call to method or property access

Hi I am getting an error on IE8 which is "Unexpected call to method or property access." 嗨,我在IE8上收到一个错误,该错误是“意外调用方法或属性。” at the line "foo.appendChild(canvas);" 在“ foo.appendChild(canvas);”行中 My codes are as follows. 我的代码如下。

 <canvas id="foo" class="canvasstyle" height="300" width="300"></canvas>

var foo = document.getElementById("foo");
var canvas = document.createElement('canvas');
canvas.setAttribute("width", 300);
canvas.setAttribute("height", 300);
foo.appendChild(canvas);
canvas= G_vmlCanvasManager.initElement(canvas);
var ctx = canvas.getContext('2d');
ctx.save();
    ctx.clearRect(0, 0, canvas.width, canvas.height);
    ctx.translate(canvas.width / 2, canvas.height / 2);
    ctx.drawImage(server, -112, -120);
    ctx.rotate(x2 * Math.PI / 180);

        ctx.drawImage( point, -198, -80 );
        ctx.restore();

Does anybody have any idea how to get rid of this error and work canvas on IE8. 有谁知道如何摆脱这个错误并在IE8上使用canvas。 Thank you for your help... 谢谢您的帮助...

I think that there is a good chance that your issue is that you are inserting a canvas into another canvas... I cannot think of a legitimate reason for this and because anything inside of a canvas element is only visible in browsers that do not support canvas, it is certainly in violation of the intended use. 我认为您的问题很有可能是您正在将一个画布插入另一个画布中……我无法想到一个合理的原因,因为canvas元素内部的任何内容仅在不支持的浏览器中可见画布,肯定违反了预期用途。

This is the intended use: 这是预期用途:

<canvas width="600" height="400">
    Your browser can't handle our site and it looks very outdated... Try installing
    <a href="https://chrome.google.com">one that doesn't suck</a>.
</canvas>

On any browser that supports canvas the message inside will not display. 在任何支持画布的浏览器上,都不会显示该消息。 Try inserting your canvas into another element. 尝试将画布插入另一个元素。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 IE8 appendChild“对方法或属性访问的意外调用” - IE8 appendChild “Unexpected call to method or property access” 在jQuery中对IE8上的方法或属性访问进行了意外调用 - Unexpected call to method or property access on IE8 in jQuery jQuery 1.11.1 appendChild错误IE8(意外调用方法或属性访问) - jQuery 1.11.1 appendChild error IE8 (Unexpected call to method or property access) 为什么此jQuery代码会导致IE8错误:“方法或属性访问意外调用” - Why does this jQuery code cause IE8 error: “UNEXPECTED CALL TO METHOD OR PROPERTY ACCESS” marionettejs attachhtml ie8-意外调用方法或属性 - marionettejs attachhtml ie8 - unexpected call to method or property JavaScript RunTime错误:appendChild() - 对IE8中的方法或属性的意外调用 - JavaScript RunTime Error : appendChild() - Unexpected call to method or property in IE8 IE7 / 8中意外调用方法或属性 - Unexpected call to method or property access in IE7/8 在IE 7中意外调用方法或属性访问 - Unexpected call to method or property access in IE 7 Javascript IE错误:意外调用方法或属性访问 - Javascript IE error: unexpected call to method or property access IE7中的“对方法或属性访问的意外调用”错误 - 'unexpected call to method or property access' error in IE7
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM