即使我在我的页面中包含了 JQuery,我也会收到这个错误...
Uncaught TypeError: Cannot read property 'post' of undefined
导致错误的行是
$.post("infusionsoft/infusion_soft_interaction.php",
{customerName: 'customerName', customerEmail: 'customerEmail'},
function(data) {
alert(data);
});
这是我页面的 HEAD
部分。
最佳答案
我认为问题出在您对 jQuery 使用无冲突模式这一事实。
您需要通过jQuery
引用它。
jQuery.post("infusionsoft/infusion_soft_interaction.php", ...
或者用一个函数包装你的代码
(function($){
$.post("infusionsoft/infusion_soft_interaction.php", ...
}(jQuery))
关于jquery - 未捕获的类型错误 : Cannot read property 'post' of undefined Even JQuery included,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24774527/