I have the following querystring (where kvks is dynamic):
http://api.openkvk.nl/json/SELECT bedrijfsnaam FROM kvk WHERE kvks = 27312152 LIMIT 1;
If you execute this querystring, it will return json data.
What is the best approach to handle this? I tried it in this way, but nothing alerts
url.append("http://api.openkvk.nl/json/SELECT bedrijfsnaam FROM kvk WHERE kvks = ");
url.append(Dossierno);
url.append(" LIMIT 1");
$.get(url, function (data) {
alert(data); });
Or should I handle this in a separate aspx page?
$.get('getaddress.aspx', { sDossierno : Dossierno} function (data) {
alert(data); });
If yes, how can I send a querystring and return the json object on the getaddress aspx page?
That’s not query string that you have. It’s part of the uri and ASP.NET won’t probably allow it. You may try the following:
where the corresponding server side script will read the
qquery string parameter.Also I hope you are aware of the implications in terms of security of having a server side script which accepts what seems to be a SQL query and executes it against a relational database. And last but not least don’t forget about the same origin policy restriction and make sure that this script is hosted on
http://api.openkvk.nlif you intend to send AJAX requests to it.