Hi Community,
Here is the skeleton of my JavaScript:
var element = arguments[0],
$ = skuid.$;
element.append('<canvas id="myCanvas" width="800" height="50"></canvas>');
setInterval(function(){
var canvas = document.getElementById('myCanvas');
var context = canvas.getContext('2d');
function ReachForTheStarsYaLongEaredGaloot(bunny) {
}
ReachForTheStarsYaLongEaredGaloot('Bugs');
}, 250);
Notice that I am using setIntervalI() to ensure that the DOM is loaded and I have access to the canvas element.
This works but I am wondering what is the proper pattern?
I suppose I could use this as an alternative:
$(document.body).one('pageload',function(){ ... });
Any guidance is appreciated.
Regards,
Irvin