私はjsonファイルを以下の形式で持っています:
[{"label":"apple","desc":"fruit"},
{"label":"banana","desc":"fruit"},
{"label":"celery","desc":"vegetable"},
{"label":"plum","desc":"fruit"},
{"label":"","desc":"fruit"}]
このデータに対してGETリクエストを実行するにはどうすればよいですか?例えば
http://www.mysite.com/data?desc=vegetable
would display [{"label":"celery","desc":"vegetable"}]
to the browser and
http://www.mysite.com/data?label=apple&desc=fruit
would display
[{"label":"apple","desc":"fruit"}]
to the browser
私がエミュレートしたい実例を以下に示します:
http://ws.geonames.org/searchJSON (returns nothing)
http://ws.geonames.org/searchJSON?featureClass=P&style=full&maxRows=12&name_startsWith=paris (returns matching cities.)
Jquery and PHP are the tools I'm using. I'm trying to set this up so I can use jQuery UI autocomplete with a remote JSONP datasource.
http://jqueryui.com/demos/autocomplete/#remote-jsonp