意外的标记 )

时间:2015-03-05 23:36:22

标签: javascript

尝试从Google Chrome控制台运行时,我一直在标题中收到错误。

var Usernames = ["Sinblade"];
var Password = ["******"];
var AccountNum = 0;
var gameID    = 000000; // Put your game ID here

for (AccountNum < Usernames.length; AccountNum++){
    document.getElementById("LoginUsername").value = Usernames[AccountNum];
    document.getElementById("LoginPassword").value = Password;
    document.getElementById('LoginButton').submit();
}

2 个答案:

答案 0 :(得分:2)

你的for循环缺少initialize子句。

如果您不想进行任何初始化,请将其留空:

for (;AccountNum < Usernames.length; AccountNum++){

答案 1 :(得分:1)

这不是for循环的工作方式:你需要在其中初始化迭代器(有一种解决方法,但不推荐)

var Usernames = ["Sinblade"];
var Password = ["******"];
var gameID    = 000000; // Put your game ID here

for (var AccountNum = 0; AccountNum < Usernames.length; AccountNum++){
  document.getElementById("LoginUsername").value = Usernames[AccountNum];
  document.getElementById("LoginPassword").value = Password;
  document.getElementById('LoginButton').submit();
}