ns_error_not_available when placed on the web server

Asked

Viewed 26 times

1

I made a mini game on the localhost and everything was working perfectly.. Then I uploaded it to the web server and the game started crashing with the error "NS_ERROR_NOT_AVAILABLE:".

...
var spriteSheet = new Image();
var player = new Sprite(spriteSheet);sprites.push(player);
...
for (var i in sprites) {
    var spr = sprites[i];
    if (spr.visible) {
        spr.draw(ctx); // erro aqui
    }
}
...

(in another file . js)

...
this.draw = function(ctx){
    ctx.drawImage(this.img, this.srcX, this.srcY, this.width, this.height,this.posX,this.posY, this.width, this.height); // erro aqui
        this.animation();
    } 
...

I have been researching on this subject and I think we need to create a function to load the images before initializing the game itself.

  • This error appears in the browser or server?

  • Error appears in browser

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.