Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок0
Code working in solo learn but not IE
So ive been working on a code on vs code and when its ran it doesnt working and returns the following error: script.js:53 Uncaught TypeError: Cannot set properties of null (setting 'innerHTML') at calculateCashPerSec (script.js:53:53) at productPurchase (script.js:85:9) at script.js:134:1 However the code works fine in the sololearn enivroment. In my vs project, it does have the CSS and JS files linked correctly, any ideas> also i cant find the add code button on desktop, so heres the link: https://www.sololearn.com/compiler-playground/WJRxRMvP9dm0
6 ответов
+ 3
+ 1
Code working in solo learn but not IE
So ive been working on a code on vs code and when its ran it doesnt working and returns the following error:
script.js:53 Uncaught TypeError: Cannot set properties of null (setting 'innerHTML')
at calculateCashPerSec (script.js:53:53)
at productPurchase (script.js:85:9)
at script.js:134:1
However the code works fine in the sololearn enivroment. In my vs project, it does have the CSS and JS files linked correctly, any ideas>
also i cant find the add code button on desktop, so heres the link:
https://www.sololearn.com/compiler-playground/WJRxRMvP9dm0
+ 1
link for phones:
https://code.sololearn.com/WJRxRMvP9dm0/?ref=app
+ 1
window.addEventListener("load", () => {
// Your code goes here
});
getElementById returns null if there is no element with that id, or the html needs to load first, so with this event, you execute your Javascript after html loading.
https://developer.mozilla.org/en-US/docs/Web/API/Window/load_event
+ 1
Are you testing in (IE) Internet Explorer, the dead browser? its 2023, im not sure if you should be doing that unless some1 is going to hire you especifically to write code for that.
0
So I just tested this on the phone app and it's giving me the same error.