mySQL DB: No 'Access-Control-Allow-Origin'


When trying to post data from my html5 app (built in Phaser and using ajax (similar code: to my cloud 9 mySQL DB – I am receiving this message – XMLHttpRequest cannot load https://xxxxx-xxxxx/development/xxxxx/php/setScore.php. No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘’ is therefore not allowed access.

I read on StackOverflow there was a bug that possibly was causing this issue but the same post said that bug was recently resolved. I would appreciate any guidance so I can continue the development.




Quick few questions:

  • Is your workspace private? Is your application url private too?
  • How are you trying to access the url that’s failing?



The work is private. I did tried to make it public but no luck.

Regarding application url – I assume this may be private – when I run the application it is

Within the application, I am trying to access the php page with the following link:

submitScore: function (username, score) {

var data="username="+username+"&score="+score;

var request = new XMLHttpRequest();'POST', '', true);
//'POST', '', true);
request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
request.onload = function() {
  if (request.status >= 200 && request.status < 400){
    // Success!
    // here you could go to the leaderboard or restart your game .
  } else {
    // We reached our target server, but it returned an error