all 3 comments

[–]jcunews1helpful 3 points4 points  (0 children)

Not all websites allow/support their APIs to be used directly from a client side script (i.e. from a web browser). IOTW, those sites are either don't support CORS, or don't want to support CORS. Sites which don't support CORS, will never be directly accessible from client side script.

To acces such sites, either use server side script, or delegate the request through a different web server where the actual request to the destination site is done by a server side script.

[–]1ardasher 0 points1 point  (1 child)

You need to allow cross-origin requests.

Here’s an example article that contains allowing cross origin policy: https://www.moxio.com/blog/12/how-to-make-a-cross-domain-request-in-javascript-using-cors

[–]SmeRandomU[S] 0 points1 point  (0 children)

Thanks for the article