我是使用 javascript 编程 phonegap 的新手!我尝试在我的项目中使用画布,但它没有用!这是我的代码:index.html:
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" charset="utf-8" src="cordova-2.5.0.js"></script>
<script type="text/javascript" charset="utf-8">
document.addEventListener("deviceready",onDeviceReady, false);
function onDeviceReady() {
}
var c = document.getElementById("mycanvas");
var ctx = c.getContext("2d");
ctx.fillStyle="#FF0000";
ctx.fillRect(0,0,150,75);
</script>
</head>
<body>
<canvas id="mycanvas" width="200" height="100" style="border:1px solid #c3c3c3;"></canvas>
</body>
</html>