Uncaught Syntax Error at loadJSON if I load from my own url

Hi,

if I use the function loadJSON with the following URL "http://api.open-notify.org/astros.json" then all work perfectly.

But if I copy exact the same data and create a new file on my own server then I get an error called:

Unexpected Token at Line 2.

this error also appears at some other json-apis.

Please, can someone help me?

Regards

Tagged:

Answers

  • Answer ✓

    I got it. Had to manipulate the file with php, so that when a JSONP-Request come the file with JSONP-Data will answer

Sign In or Register to comment.