发布 Facebook 评论时,我想使用 ajax 触发 php 代码来发送电子邮件。php电子邮件代码正在工作。facebook代码正在运行。我被困在ajax上。我的代码是:
FB.Event.subscribe("comment.create", function() {
$.ajax({type: "POST",
url: "//thesite.com/mail.php",
success: function() {
alert("Request Sent.");
}
});
我有一个控制台错误:TypeError: $.ajax is not a function 我的 ajax 代码有什么问题?我需要运行 mail.php 文件。