Electric imp origin is not allowed by Access-Control-Allow-Origin

Is there any solution for this? I’ve tried some vaguely described methods and none of them worked. My html code works fine when the file is local but once I upload it to a web host, I get errors:

[Error] XMLHttpRequest cannot load https://agent.electricimp.com/xxxxxxxxx?led=1. Origin http://glorincz.xxxx.net is not allowed by Access-Control-Allow-Origin. (imp.html, line 0)

I’ve tried putting all these stuff in the agent code and they didn’t work:

Access-Control-Allow-Origin: http://glorincz.xxxx.com res.header( "Access-Control-Allow-Origin", "http://glorincz.xxxx.com" ); res.header( "Access-Control-Allow-Methods", "POST" ); res.header( "Access-Control-Allow-Headers", "Content-Type, Content-length");

What am I doing wrong?

Looks like your Access-Control-Allow-Origin header doesn’t match up with where the request is coming from (glorincz.xxx.net vs glorincz.xxx.com")

This should work:
res.header ("Access-Control-Allow-Origin", "glorincz.xxx.net/*");

And replace the xxx with the missing part of the url.

Thank you very much!