0
Document.write(); in js showing an error in comodo editor page , can any one help me to know why is this happening ? please .
document.write (); error
3 Respuestas
+ 1
If you run the same code in a different editor and it works, then you should contact support for the editor that gets the error. If you run the same code in a different editor and it still throws the same error, there is something wrong with the code, in which case, we would have to see the whole thing to properly diagnose, so you should share the full code (preferably in the Code Playground).
The Code Playground should be relatively easy to find in the website version of SoloLearn, but if you are in the app version, it can be accessed via the curly braces, green circle with plus sign to add a new project, then select the project type.
Looking forward.
0
okey , thanks , I will share the whole example
function generateYears (start, end){
"use strict";
var years;
document.write("<select>");
for(years = start ; years <=end; years++){
document.write("<option value =\"" + years + "\">" + years + "</option>");
}
document.write("</select>");
}
generateYears(1900, 2018);
0
Seems to work fine here:
https://code.sololearn.com/WpbX8S95ouQK/?ref=app