CORS header error with REST API

I get this error when my application loads and calls the REST API:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://jad.fsmserver.com/omeka/api/… [I deleted the rest]
CORS header ‘Access-Control-Allow-Origin’ missing

If I refresh the page the error disappears and I get the data I am expecting. Do I need to add something to .htaccess? I am running on my localhost right now. I tried adding this to the .htaccess file where Omeka Classic is running but it doe snot help.

Header set Access-Control-Allow-Origin *

Thanks.

This error goes away when the application is running from the same domain as Omeka. It is just an issue when running localhost on my computer with Omeka on the web host.

That’s a cross-origin request problem, yeah.

Setting the Access-Control-Allow-Origin header as you described should resolve the problem. When I look at the API you linked to, I don’t see the header there, though.