I'm trying to decide that JSL is warning about two things, I do not know how Have to decide. Which line should change the code? I have pasted the code in question and warned about them very early thanks for your suggestions / answers.
Jayslin says: At issue 137: A conditional expression was expected and instead an assignment was seen. at issue 140: expected '{ 'And' Return 'was seen instead. If you want to please JSLint, you can add blank jars to clarify: Remember that JSLIT is partly about Crockford's personal preferences, which you do not always have to agree to. Edit: OK, second error is because JSLIND wants that you put the leak in the braces, like: This is also the style that I like in code. I think it avoids some errors. However, it is subjective again, the clear business fact is that it adds two rows. while (elem = document.getElementById ("optionsDiv" + g))
Return g;
function isAnyOptionVisible () {Var g = 0; While (elem = document.getElementById ("optionsDiv" + g)) {if (elem.className === "optionsDivVisible") returns g; G ++; } Return -1; There is nothing wrong with the condition, except that
elem
var elem, g = 0;
while ((elem = document.getElementById ("OptionsDiv" + G))! == faucet) I do not see anything about "expected {"}, however, by putting G ++ on the same line, weird brace Is the style.
if (elem.className === "OptionsDivVisible") {return g; } G ++;
Comments
Post a Comment