jquery - Ajax request for autocomplete doesn't work -


i have ajax request data of autocomplete database. request :

$(function() {     $("#client").autocomplete({         minlength: 1,         autofocus: true,         source: function(request, response) {             $.ajax({                 url: "jsonclients.php",                 datatype: "json",                 data: {                     q: request.term                 },                 success: function(data) {                     alert('success');                     response(data);                 }             });         }     }); }); 

this code input <input type='text' id='client' name='client'>. data received looks ok browser console nothing appens when type something, alert('success') isn't displayed.

note : code working on ie8 server, isn't working on ie9/firefox/gchrome real windows session in intranet

thanks!

ok found getting wrong.

for reasons, utf8 encoding (from notepad++) makes json_encoding bugging causing blank space @ beginning of result.

to resolve it, need encode files utf8 without bom , it'll no more have blank space no more json_error unexpected token or whatever.

thanks guys


Comments