Search code examples
javascriptairxmlhttprequest

air xmlhttprequest can't send GET parameters


This is the code that's called on a button click and works fine

var console = console || 
    {log:function(msg){window.runtime.trace(msg);}};
    console.log("opening link:"+bannerurl);
    var xmlhttp = new XMLHttpRequest(); 
    xmlhttp.open("GET", bannerurl,false);
    xmlhttp.send(null);
    document.getElementById("banner").innerHTML=xmlhttp.responseText;

output is:

opening link:http://www.mysite.com

when I add the following line:

bannerurl=bannerurl+"?hi=22";

The output is:

> opening link:http://www.mysite.com?hi=22 
> Error: NETWORK_ERR:XMLHttpRequest Exception 101 
> setup1 at app:/js/result.js : 435

The url http://www.mysite.com?hi=22 (replaced real url with mysite as example) works perfectly fine and the code works fine in Firefox with forcecors but won't run in AIR.

rant about AIR will answer this question later when I am allowed. The problem was that IE was set to work offline so only pages that were already cached worked but not the new ones (with different GET parameters)


Solution

  • I found out that Internet explorer was in offline mode. I almost never use IE so didn't notice this.