1 Reply Latest reply on Apr 2, 2008 3:12 PM by PaulJTaylorPWD

    Ajax Call in Sandbox

    PaulJTaylorPWD
      I'm trying to make an Ajax call to a remote server from inside a non-application sandbox using the AIR 1.0 SDK.

      I have the allowcrossdomainxhr parameter of the non-application sandbox's IFRAME set to "yes."

      I can put this code in both sandboxes:

      var url = ' http://mydomain.com/samplepage.php';
      var ajaxCall = new XMLHttpRequest();
      ajaxCall.open("GET",url,true);
      ajaxCall.onreadystatechange=function(){
      if(this.readyState == 4){
      var r = this.responseText;
      var s = this.status;
      }
      }
      ajaxCall.send(null);

      (The samplepage.php script simply outputs "TEST.")

      In the application sandbox, this code returns "TEST" as the value of r, and the value of s (the call's status) is 200. In the non-application sandbox, however, the value of r is empty, and the value of s is zero. The readyState does indeed equal four in both instances.

      This happens regardless of the value or the presence of allowcrossdomainxhr.

      Am I missing something regarding the privileges granted by allowcrossdomainxhr?