Javascript - Unexpected Identifier For Loop
I am trying to write a kind of brute force script in javascript! This is what I have so far: var charset = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j,', 'k', 'l', 'm', 'n', '
Solution 1:
for(int i = 0; i < charset.lenght; i++){
should be for(var i = 0; i < charset.length; i++){
Also inline event handlers like <input onClick = "bruteForce()" name="input" type="image" src="arrow.jpg" align="right" />
expect the handler to be in global scope.
So if the code you shared is enclosed in some other wrapper function, it probably won't work. Otherwise it's the first syntax error causing the second as well...
Solution 2:
Length is spelt wrong in your for loop. It should be length not lenght.
Post a Comment for "Javascript - Unexpected Identifier For Loop"