I’m looking at some code for a shoutbox at yensdesigns, and in this function it’s checking to make sure the form fields are complete. What’s with all the ampersands? Is that important? I’m a newbie/hobbyist, don’t really get what he’s doing with that?
//check if all fields are filled
function checkForm(){
if(inputUser.attr("value") && inputMessage.attr("value"))
return true;
else
return false;
}
Is it the same if I write
//check if all fields are filled
function checkForm(){
if(inputUser.attr("value"); inputMessage.attr("value"))
return true;
else
return false;
}
It’s an error in the function (and the guide, shame on them). The correct one would be: