I am using html5 to do this basic function of pasting the same image in a canvas. It seems to work fine in Chrome and FF but when I open it in Opera, w开发者_StackOverflow社区ith help of localhost it goes crazy with pop up (alert like)
Now it goes on like 186, 372, 558, 744, 930, 116, etc. it doesn't stop!
Can anyone figure out what's wrong? There is my code
imageObj.src = "Crystal-outline.gif";
var start=0; var total=150;
i=start;
for (var x=0; x <= 870;x += 30 ) {
for (var y=0; y <= 120;y += 30 ) {
my[i]=imageObj;
context.drawImage(my[i], x, y);
i++;
}}
Image is 30x30 pixel.
This is weird, but try disabling user scripts, extensions and possibly even browser.js to figure out if any of those cause the alert()
s. If you're using some JS library or code you haven't written, check the entire source code for calls to the alert()
method. Or..try to add this to your code:
window.alert=function(){ try{undefined();}catch(e){opera.postError(e.stack);} }
which should show in the error console the entire call stack of the alert() call.
精彩评论