Javascript在網頁就可以執行不需要開啟Spyder 劉任昌執行 以上程式碼 <STYLE>BUTTON{BORDER:GREEN 5PX SOLID;BORDER-RADIUS:30PX;}</STYLE> <h1>Javascript在網頁就可以執行不需要開啟Spyder</h1> <button onclick="LH()">劉任昌執行</button> <canvas height="400" id="my" style="background: black;" width="1200"></canvas> <script> function LH() { var c = document.getElementById("my"); var cty = c.getContext("2d"); var x = 0; var y = 200; var h = 100; cty.beginPath(); cty.lineWidth = 5; cty.moveTo(x,y); while (x < 1000){ x = x + 1; y = 200 - h * Math.sin(0.2*x); cty.lineTo(x, y); cty.strokeStyle = "yellow"; cty.stroke(); }; } </script>
https://jhuang-huei.blogspot.com/2023/12/javascriptobjectcanvas.html
回覆刪除https://zzl1102.blogspot.com/2023/12/canvassvg.html
回覆刪除