本文介绍了使用Opera在JavaScript中更新图像源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我定期使用Image对象加载远程图像,以便稍后在画布上绘制。 Image对象仅在JS中创建,在DOM中不存在。

I am loading remote images periodically with an Image object to be later drawn on a canvas. The Image object is created in JS only, it doesn't exist in DOM.

该代码适用于Chrome和Firefox。在Opera中,问题是浏览器似乎总是在修改图像源时切换到加载模式,即光标变为等待,并且Opera将Elements:X / Y添加到地址栏。

The code is working fine with Chrome and Firefox. In Opera the problem is that the browser seems to always switch to "loading mode" whenever image source is modified, i.e. the cursor changes to the "waiting" one and Opera adds "Elements: X/Y" to the address bar.

以下是测试代码:

有没有人知道这种Opera行为的解决方法?

Does anyone know any workaround for this Opera behavior?

推荐答案

正如@graste所指出的,Opera 12.50修复了这个错误。从他们的更改日志:

As @graste pointed out, Opera 12.50 has this bug fixed. From their change log:

这篇关于使用Opera在JavaScript中更新图像源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-27 15:50