Jump to content

Mackenzie17

Members
  • Content Count

    2
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Mackenzie17

  • Rank
    Newbie
  1. hi Ingolmethanks for replying, I tried replacingself.c = self.canvas.getContext("2d"); withself.c = d.getElementById("can").getContext("2d"); with that code the error console says"Cannot convert 'd.getElementById("can")' to object"the script is deferred so the page should be loaded before the script is executed thanks
  2. Hi I'm a little new to JavaScript and I am trying to make a small program using an HTML5 canvas. However, when the following code is executed:function Prog(){ var self = this; this.init = function() { var d = document; self.canvas = d.getElementById("can"); self.c = self.canvas.getContext("2d");...}var p = new Prog();p.init();The code works in the other major browsers, but in opera, it throws an error saying "cannot convert self.canvas to object" or sometimes just "self.canvas is null"Thanks in advance
×
×
  • Create New...