자바 스크립트가 작동하지 않는 데 심각한 문제가 있습니다. 그것은 내 브라우저 (파이어 폭스)에서 활성화되어 있으며 다른 브라우저에서 코드를 테스트하려고 시도했습니다 ... 내 코드는 다음과 같습니다. 이슈가 뭐야?자바 스크립트가 작동하지 않습니다.
<html>
<head>
<title>DRAW</title>
<link rel="stylesheet" type="text/css" href="style.css">
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0-alpha1/jquery.min.js"></script>
</head>
<body>
<canvas id="draw" height="300" width="300"></canvas>
<script type="text/javascript">
function draw() {
var ctx = document.getElementById('draw').getContext('2d');
var img = new Image();
img.onload = function(){
ctx.drawImage(img,0,0);
ctx.beginPath();
ctx.moveTo(30,96);
ctx.lineTo(70,66);
ctx.lineTo(103,76);
ctx.lineTo(170,15);
ctx.stroke();
};
img.src = 'https://mdn.mozillademos.org/files/5395/backdrop.png';
}
</script>
</body>
</html>
전화 천국을 위하여 기능! –
당신은 무엇을 기대하고 있습니까 – bwegs
어떤 오류가 있습니까? – ssube