2013-05-27 2 views
1

에서 작동하지 않는이 내 코드

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}); 
    } 
}); 

그러나 나는 다음과 같은 오류

Uncaught TypeError: Object function (e,l){return document.id(e,l,this.document); } has no method 'post'

받고 있어요하지만 같은 방법은 내 이전 프로젝트를 위해 잘 작동 .. .. 누구나 전화 와트 수줍음을 할 수 있습니까 ??

+0

귀하의 페이지에 _ $ _ 충돌이있는 것 같습니다.'$'대신'jQuery'를 사용해보십시오. – undefined

+0

jQuery도 제대로 포함되어 있습니까? –

+0

가능한 중복 [매우 이상한 jQuery 오류] (http://stackoverflow.com/questions/13708465/very-weird-jquery-error) – undefined

답변

1

jQuery를 포함하지 않았거나 충돌이있는 것 같습니다. 프로젝트에 jQuery를 포함하고 $ 네임 스페이스를 사용하는 다른 라이브러리가 없거나 noConflict 모드로 실행하려면 jQuery를 설정해야합니다.

관련 문제