Closed carwin closed 9 years ago
I'm working with the geonames service and there are times when I need to specify the same param twice for something like limiting results to only two countries. The URL might look something like this:
http://api.geonames.org/searchJSON?name=chicago&country=US&country=CA
For that I'd need,
params: { country: 'US', country: 'CA', }
Since the params option is an object, I can't add country twice, so it'd be nice if params could take arrays, something like:
params
country
params: { country: ['US', 'CA'] }
Is there another way to do this that I'm missing?
Params passed as data parameter for jquery's ajax method.
Then only way to work around this, would be instead of serviceUrl as string, you pass a function, which would format url for the request.
Cool thanks.
I'm working with the geonames service and there are times when I need to specify the same param twice for something like limiting results to only two countries. The URL might look something like this:
http://api.geonames.org/searchJSON?name=chicago&country=US&country=CA
For that I'd need,
Since the
params
option is an object, I can't addcountry
twice, so it'd be nice ifparams
could take arrays, something like:Is there another way to do this that I'm missing?