window.onload=function(){
var canvas=document.getElementById("canvas");
canvas.width=800;
canvas.height=800;
var context=canvas.getContext("2d");
context.font="bold 40px Arial";
context.fillStyle="#058";
context.fillText=("快乐学习,快乐进步!",40,100);
context.lineWidth=1;
context.strokeStyle="#058";
//context.strokeText("快乐学习,快乐进步",40,100);
context.fillText=("快乐学习,快乐进步",40,300,400);
//context.strokeText("快乐学习,快乐进步",40,400,400);
}这样写就看不到文本了
你这代码写的没问题可以看到啊,你自己看看标点符号中英文。也可以F12看看错误提示。
context.fillText=("快乐学习,快乐进步!",40,100);
改为context.fillText("快乐学习,快乐进步!",40,100);
去掉等号“=”