首页 > 其他分享 >[canvas]ncaught TypeError: Cannot read properties of null (reading 'getContext')

[canvas]ncaught TypeError: Cannot read properties of null (reading 'getContext')

时间:2022-11-30 13:45:44浏览次数:32  
标签:canvas TypeError read null html getContext Cannot js

相信你和我一样是直接复制大佬的js代码(笑)

————————————

主要问题在于:js先加载完了,html才加载,导致js获取不了html的对象

解决办法:

 

 

标签:canvas,TypeError,read,null,html,getContext,Cannot,js
From: https://www.cnblogs.com/cela/p/web-js-canvas-1.html

相关文章