My understanding is that if it is a cross-domain request, we are supposed to set dataType to “jsonp”. Which I did, but then it did not work. I got the following error message in the console:
There’s another, newer way of making cross-origin request: CORS. If a provider (server) supports it, a client can just send normal requests without any additional setup. That’s why your request succeeded.
If you want to use jsonp, you need to provide an additional parameter ( _jsonp) to your query string to inform the provider that’s the format you want to use (as you can read in api docs).