【发布时间】:2013-05-27 08:01:38
【问题描述】:
这是我的代码
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){return document.id(e,l,this.document); } 没有方法'post'
但是对于我之前的项目,同样的方法可以正常工作....任何人都可以打电话吗??
【问题讨论】:
-
您的页面中似乎存在 $ 冲突,请尝试使用
jQuery而不是$。 -
jQuery 是否正确包含在内?
-
Very weird jQuery error 的可能重复项