I have a central page that generates directory names on the server and I need to pull that into my page. Currently it’s on two separate domains. I was using $.get('url') but since it was on different domains, I was getting the following error:
Origin http://domain is not allowed by Access-Control-Allow-Origin.
I swapped to using $.getJSON('url'); and it retrieved the information that I needed, but I got
Uncaught Syntax Error: Unexpected token
as it wasn’t in JSON format. All I want is to be able to access the generated directory name.
Any pointers?
Use jsonP parameter for cross domain calls. Also search for comet or long polling.