Browse Source

Fixed stupidity.

dev-tmpl
Bryan Miller 6 years ago
parent
commit
7994c578be
2 changed files with 5 additions and 7 deletions
  1. +4
    -4
      app/js/main.js
  2. +1
    -3
      index.html

+ 4
- 4
app/js/main.js View File



function initialize(DOC){ function initialize(DOC){
console.log(DOC); console.log(DOC);
var canvas = DOC.getElementByID("painter");
var canvas = DOC.getElementById("painter");
if (!canvas){ if (!canvas){
throw new Exception("DOM Missing painter canvas.");
throw new Error("DOM Missing painter canvas.");
} }
var ctx = canvas.getContext("2d"); var ctx = canvas.getContext("2d");
if (!ctx){ if (!ctx){
throw new Exception("Failed to obtain canvas context.");
throw new Error("Failed to obtain canvas context.");
} }
} }




//console.log(document.getElementByID("painter")); //console.log(document.getElementByID("painter"));
//initialize(document);
initialize(document);

+ 1
- 3
index.html View File

<canvas id="painte"></canvas> <canvas id="painte"></canvas>


</body> </body>
<script src="app/js/main.js">
initialize(document);
</script>
<script src="app/js/main.js"></script>
</html> </html>

Loading…
Cancel
Save