loadStrings() gives network error in Js mode but works fine in Java...

edited April 2015 in JavaScript Mode

I caught this exception :

Screenshot_2

on running String incoming[]=loadStrings("http://kanoodle.hol.es/sss.php?type=load");. The php script is perfectly fine and the sketch ran properly in Java mode... Help!
Using loadStrings as here

Answers

  • edited April 2015

    Nope! None of them mention loading from a file with HTTP prefix... Nobody seems to reported any bug so must be a problem with my code but it works perfectly in Java! You are a moderator rite? Do you mind if i post it on stackoverflow? will it considered as cross questioning?

  • I only moderate SPAMs. And it's prefectly OK cross-posting.
    Although it's kindness to post this thread link there, and post theirs here!

  • edited April 2015

    Okay that was a problem with Javascript definition... Only script under the same domain can talk to each other(funky phrase Cross origin requests are not allowed)... So when i uploaded it to the server everything(almost) was fine... Java has no such restrictions...

  • Answer ✓

    Yes, it was an issue of origin. This can be solved with CORS or JSONP, but the target server must support them, otherwise you are out of luck.

    Java doesn't has such restriction because it is less a security issue. JS is more sensitive for security reasons.

Sign In or Register to comment.