我得到这个语法错误,因为我错过了}有人可以告诉我我可能忽略了什么......这说行25,但我没看到它。语法错误Jquery AJAX调用
错误
SyntaxError: missing } after property list
代码
$(document).ready(function(){
// What happens when a user hits the "Accept" button on the dealer form
$(".label_accept").click(function(){
$('#LabelMaker').modal('hide');
});
$('#labelForm').on('submit', function(e){
e.preventDefault();
alert($(this).serialize());
$.ajax({
// the location of the CFC to run
url: "index_proxy.cfm",
// send a GET HTTP operation
type: "get",
// tell jQuery we're getting JSON back
dataType: "json",
// send the data to the CFC
data: $('#labelForm').serialize(),
// this gets the data returned on success
success: function (data){
console.log(data);
}
// this runs if an error
error: function (xhr, textStatus, errorThrown){
// show error
console.log(errorThrown);
}
});
});
你试过我的代码吗?它仍然会抛出错误。我指出了两个错误。 – 2015-10-06 17:58:34
@Vicki我正在查看它。 – 2015-10-06 18:01:09
@Vicki你可以通过检查F12开发工具的Console Tab来显示AJAX调用的输出吗? – 2015-10-06 18:03:18