Unexpected semicolon in function from chrome dev tools

elkoi

New Member
Chrome developer tools says this function has an unexpected semicolon after the 3rd closing curly brace. Isn't it supposed to go there to end the var form declaration? Otherwise if I don't have it chrome says that the 4th curly brace shouldn't be there.What am I doing wrong with this code:\[code\]function submitForm(form) { var form = $("form").submit(function() { var formData = http://stackoverflow.com/questions/14412145/new FormData(form); console.log("formData"); var XHR; if (window.XHMLHttpRequest){XHR = new XHMLHttpRequest();} else {XHR = new ActiveXObject("Microsoft.XMLHTTP");} XHR.open("POST","mail.php",true); console.log("XHR opened."); XHR.onreadystatechange = function(e) { if (this.readyState == 4 && this.status == 200) { XHR.send(formData); console.log("Sent formData."); } } };}\[/code\]Any help is greatly appreciated.
 
Back
Top