I am evaluating trigger.IO and wanted to setup a simple test with some of the data from my web service. I had a simple jquery ajax request that I I simple changed to use the forge api for ajax and when I run the build it always states
XMLHttpRequest cannot load http://mydomain.com/file. Origin content://io.trigger.forge0872041a3f3011e291d722000a9f3c85 is not allowed by Access-Control-Allow-Origin. — From line 1 of null
No mater what I do I cannot seem to get this simple ajax request to work.
Now when I look in the config it should (from the looks of it) already allow you to do it to any site but I even added the site I was trying to hit and the same thing..
What makes it even stranger is that I tried doing the boilerplate and that worked fine but I’m using almost identical ajax request only when I try and hit my server I get the cross domain issue.
Thanks.
You need to use the forge.request module to do cross-domain requests with Trigger.io:
http://docs.trigger.io/en/v1.4/modules/request.html#modules-request
The permissions in src/config.json apply only to that module – you cannot use normal XMLHttpRequest unless you have enabled CORS on your server.