Discuss / JavaScript / 不知道为什么报错?SyntaxError: Unexpected token ILLEGAL

不知道为什么报错?SyntaxError: Unexpected token ILLEGAL

Topic source

噗噗哧啊

#1 Created at ... [Delete] [Delete and Lock User]
// TODO:
var input_username = document.getElementById('username').value;
var re_username = \w{3,10};
var password = document.getElementById('password').value;
var password2 = document.getElementById('password-2').value;

if(!re_username.test(input_username))
   return false;
if (password.length<6||password.length>20)
  return  false;
if (password !== password2)
  return false;
else return true;

}


  • 1

Reply