我创建了一个表单来获取用户的反馈,我只是尝试将表单数据发送到 url,但我收到此错误:
未捕获的类型错误:无法读取未定义的属性“ajax”
function sendData(){
$.ajax({
url: "www.yashkjhsah.php",
type: "POST",
async: true,
data: $(".contacts_form").serialize(),
dataType: "html",
success: function(data)
{
alert(data);
if(data!="Error in Insert Query!")
{
alert("Thank you for Enquiry we will send answer in your Mail.");
}
else
{
alert("Error while saving the data");
}
}
});
}
我遇到了同样的问题,通过将美元符号 $ 更改为jQuery.
jQuery.ajax({
type: "POST",
url: "...",
data: jQuery('myForm').serialize(),
success: function(msg) {
console.log('success!');
},
});
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)