// PhoneGap is ready // function onDeviceReady() { var h = screen.height - 40; var w = screen.width - 20; var c=document.getElementById("myCanvas"); c.setAttribute('width', w); c.setAttribute('height', h); var cxt=c.getContext("2d"); cxt.fillStyle="#FF0000"; cxt.fillRect(0,0,w,h); }