2012-08-29 4 views
0

작동하지 않습니다 나는 JQuery와 tagit API를 사용하고 그리고 난 여기jQuery를 TagIt : 자동 완성

$(document).ready(function() { 
    $("#mytags").tagit({ 
    tagSource: function(search, showChoices) { 
     $.ajax({ 
     url: "http://localhost/UI/user/taggin.php", 
     data: {search: search.term}, 
     success: function(choices) { 
      showChoices(choices); 
     } 
     }); 
    } 
    }); 
    }); 

처럼 내 코드를 작성 그리고 한 나의 HTML

같은

  <tr>       
        <td>Tags</td> 
         <td><input id="mytags" class= "ulc" name = "mytags"></ul> 
        </td> 

       </tr> 

http://localhost/UI/user/taggin.php 반환되는 데이터입니다

["tag1","tag2","surgeon"] 

json 형식

,

내 자동 완성 여기에

+1

jquery가 tagit보다 낫다 –

+0

@DariushJafaric thaks – user1614526

답변

0

작동하지 수 있도록이

tagSource: function(search, showChoices) { 
    var that = this; 
    $.ajax({ 
     url: "/tags/autocomplete.json", 
     data: { 
      q: search.term 
     }, 
     success: function(choices) { 
      showChoices(that._subtractArray(choices, that.assignedTags())); 
     } 
    }); 
}​ 

github issue