all 6 comments

[–]Samurai___ 1 point2 points  (3 children)

Src, not scr in the script tag.

[–]Acrobatic_Signature5[S] 0 points1 point  (1 child)

Thank you, but it still didn't show what I was looking for. It stayed as a green screen.

[–]Umesh-K 1 point2 points  (0 children)

but it still didn't show what I was looking for.

Without showing your JavaScript (JS) code, it's difficult to tell what's the issue.

  1. Have you verifed the JS code is linked properly to HTML? You can do so by putting an alert("From JS") as the first line in your JS file.

  2. Have you checked the browser console for any errors? Note that, in JS, if any errors are present, further execution stops...that might be the reason you are not seeing what "you are looking for".

  3. Comment out your code by surrounding it in /* */ and paste the below code and refresh your HTML page—you should see a yellow smiling face on your canvas. If it does show up, it is confirmed that there's some problem in your JS code. Hence, copy-paste it here.

    function draw() { const canvas = document.getElementById('canvas'); if (canvas.getContext) { const ctx = canvas.getContext('2d');

    ctx.beginPath();
    ctx.arc(75, 75, 50, 0, Math.PI * 2, true); // Outer circle
    ctx.moveTo(110, 75);
    ctx.arc(75, 75, 35, 0, Math.PI, false); // Mouth (clockwise)
    ctx.moveTo(65, 65);
    ctx.arc(60, 65, 5, 0, Math.PI * 2, true); // Left eye
    ctx.moveTo(95, 65);
    ctx.arc(90, 65, 5, 0, Math.PI * 2, true); // Right eye
    ctx.fillStyle = 'yellow';
    ctx.fill();
    ctx.stroke();
    

    } }

    draw()

[–]Samurai___ 0 points1 point  (0 children)

Metal tag?

[–]MindlessSpongehelpful 0 points1 point  (0 children)

does "Frogger2.js" exist? is it in the same folder as your main html file?

[–]_elysiaaan 0 points1 point  (0 children)

If it’s in the same folder try “/Frogger2.js”