+ 1
JS script is ignored by browser
Hello everyone, I have a big problem in web languages, I'm writing the code with html and JS, but the browser ignores totally the scripts located in body section (the head ones works correctly), I'm pretty sure to have put html tags in the right way. I haven't any idea of what it can be, let me know if I have to post the code too to have an answer (now it's on another device).
8 odpowiedzi
+ 7
Lorenzo Parisi that is because you don't use comma(,) in for loop.
use semicolon to separate them
for(i=0;i<tot.length;i++){
document.write(tot[i]+"<br/>");
}
+ 6
Uh, maybe you have JavaScript disabled from your browser.
+ 6
please show us your code
+ 2
EmmanueLZ. In fact that's weird, a mistake at the end of a script cause an error that make all the code between script tags ignored🤔🤔
+ 1
Lorenzo Parisi hi,
yes it would be better with the code or at least to tell if some error messages are return from the console and which they are.
+ 1
This is the code, the WebStorm debug says that the FOR cycle cannot complete without throwing an exception, while Code playground says that the ")" in the for cycle is not expected
https://code.sololearn.com/W2yFBGQ1P2t7/?ref=app
+ 1
🔫 Rick Grimes ops I made a silly error😅, I have to exercise a lot, thank you
+ 1
Also, shouldn't your var tot be an array ? var tot=[x,y,,z,w,h,g]
But before getting to that lines you should have at least your alert ("benvenutto") working.
So I don't know.