As I can see there is no errors in code, but still its showing this SyntaxError: missing ; before statement screenshot
Here is the Form:
<form id="bildo_mc_form" action="https://stylishcreativity.us3.list-manage.com/subscribe/post-json?u=7c7040d58ca368b8f8063c1ea&id=f67dfc67a4" method="post">
<input id="mc-email" type="email" name="EMAIL" placeholder="Your Email">
<label for="mc-email"></label>
<button type="submit">Send</button>
</form>
Here is the Js:
jQuery("#bildo_mc_form").submit(function(e){
console.log("form submitted");
function callbackFunction(data){
window.location.href = "http://thanks.com";
console.log("sucess result" + data.result);
console.log("sucess msg" + data.msg);
}
var url = jQuery(this).prop('action'); // the script where you handle the form input.
jQuery.ajax({
type: "GET",
url: url,
data: jQuery("#bildo_mc_form").serialize(), // serializes the form's elements.
dataType: "jsonp",
contentType: "application/json; charset=utf-8",
error: function(error){
// According to jquery docs, this is never called for cross-domain JSONP requests
console.log("Error Result" + error.result);
},
success: callbackFunction
});
e.preventDefault(); // avoid to execute the actual submit of the form.
});
How can I get rid of this issue? Pls help :)