I'm newbie at all in jQuery and JSON, and spent hours but it still not solved the problem
JSON from server is valid, checked through jsonlit.com but it still show all data (not filtered).
JSON from serverURI.asp
["A. ASRUNADI", "A. MURSYID", "A. RIFANI", "A.Z MAKMUR IS", "ABBAS", "ABDI IRWANTO"]
my jquery
$("#keyword").autocomplete({
source: function(request, response){
$.getJSON("serverURI.asp", function(data){
var source = data
response(source);
});
}
});
but.... when i put JSON as var in jquery its works... meanwhile i already use utf-8 in my html meta tag
$(function() {
var availableTags = ["A. ASRUNADI", "A. MURSYID", "A. RIFANI", "A.Z MAKMUR IS", "ABBAS", "ABDI IRWANTO"];
$("#keyword").autocomplete({
source: availableTags
});
});
my ASP (classic) to generate JSON as follow
dim strResultEMP
strResultEMP = "["
for strEmpCount = 0 to strTotalCountEmp
strEmpObj = split(strEmpSplit(strEmpCount), "$$$")
if strEmpCount < strTotalCountEmp then
strResultEMP = strResultEMP & """" & ucase(strEmpObj(1)) & """" & ", "
else
strResultEMP = strResultEMP & """" & ucase(strEmpObj(1)) & """" & ""
end if
next
strResultEMP = strResultEMP & "]"
response.write strResultEMP
FYI, I use JSON2.asp and JSON UTIL, but it still same. to debug and catch the server response I use Firebug.
serverURI.asp