Advertisement
fahmihilmansyah

aa

Jun 22nd, 2015
325
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  $("#ktasal").autocomplete({
  2.       minLength: 2,
  3.             source:function(req, tbh){
  4.                 $.ajax({
  5.                     url: "http://api.jne.co.id:8889/iframe/server/server_city.php",
  6.                             dataType: 'html',
  7.                             type: 'GET',
  8.                             data:
  9.                             {
  10.                                 term: req.term,
  11.                                
  12.                             },
  13.                             success:
  14.                                 function(data){
  15.                                 console.log(data.code);
  16.                             },
  17.                 });
  18.             },
  19.             select: function( event, ui ) {
  20.                 $('#result').empty();
  21.                 $('#result').append("<input type='text' id='id_kota' name='id_kota' value='" + ui.item.id + "' size='10' />");
  22.             },
  23.         });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement