Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

autocomplete using jquery json not working

 
suki sahu
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I am looking for a autocomplete option(like google search) and for that i got this link
http://jqueryui.com/autocomplete/#remote-jsonp
I copied the codes and wanted to run from my local file.
In the given code i made some changes here.
From
url: "http://ws.geonames.org/searchJSON",
url: "/searchJSON.json",

searchJSON.json is a file that have all datas from http://ws.geonames.org/searchJSON

But when i run this code its not working at all.
Can anybody please tell me is this the right way or not?

Actually my requirement is to show autocomplete which retrieves from mysql.
So i thought of creating a java class and write to file in json format.
If any other ways are there you are most welcome

 
Hussein Baghdadi
clojure forum advocate
Bartender
Posts: 3479
Clojure Mac Objective C
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean by "it is not working"? What is the error you are getting?
 
suki sahu
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
not working its not running at all.
Suppose when you enter something in the text field like 'new' then it will display new york as it is displaying in the jquery site http://jqueryui.com/autocomplete/#remote-jsonp
Please see this
http://jsfiddle.net/bqjWS/
if i replace this line
url: "http://ws.geonames.org/searchJSON",
with my my local file as


url: "JSON.json",

I have copied all the values when you open http://ws.geonames.org/searchJSON to JSON.json file
Then this is not working(not running autocompletion).
Please tell me if this is the way or not.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!