Sure, but there is no way the code could know what the error is if the JavaScript doesn't relay what square the user clicked. As far as the code is concerned, it gets an empty string, so of course that is not a valid square. How could it know the user tried to expose his king?
Sure, but there is no way the code could know what the error is if the JavaScript doesn't relay what square the user clicked. As far as the code is concerned, it gets an empty string, so of course that is not a valid square. How could it know the user tried to expose his king?