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?