$.post()在Jquery中不起作用
这是我的密码$.post()在Jquery中不起作用,jquery,.post,Jquery,.post,这是我的密码 var citylist = []; var index = 0; var url = "http://test.com/index.php"; var posting = $.post( url, { keystring: ""}); posting.done(function( data ) { $.each(data, function(key, value) { console.log(data); $.each(data, functio
var citylist = [];
var index = 0;
var url = "http://test.com/index.php";
var posting = $.post( url, { keystring: ""});
posting.done(function( data ) {
$.each(data, function(key, value) {
console.log(data);
$.each(data, function(key, value) {
citylist[index] = value;
index++;
});
if (index > 0) {
$( "#destination_to" ).autocomplete({source: citylist});
}
});
但是我得到了以下错误
未捕获类型错误:
目标函数(e,l){返回document.id(e,l,this.document);
}没有方法“post”
但是同样的方法也适用于我以前的项目……有人能告诉我应该怎么做吗?看起来你没有包括jQuery或者有冲突。确保将jQuery包含到项目中,并且没有其他库使用
$
名称空间,或者将jQuery设置为在noConflict
模式下运行。似乎没有包含jQuery,或者存在冲突。确保将jQuery包含到项目中,并且没有其他库使用$
名称空间,或者将jQuery设置为在noConflict
模式下运行。您的页面中似乎存在$冲突,尝试使用jQuery
而不是$
。jQuery是否正确包含?可能的重复项您的页面中似乎存在$冲突,尝试使用jQuery
而不是$
。jQuery是否正确包含?可能的重复项