Hi

When I try to make a http request when the network is offline, it
seems to come back with strange results.

For example, I used a managed resource store to store an index.html &
index.js file offline, and then when I work offline and have some
script make a GET request with the beta.httprequest object, calling
req.status in the onreadystatechange event throws an "Internal error"
in Firebug.  Also, when I check req.responseText, it comes back with
random gibberish, which I'm guessing has something to do with some
memory being allocated but never used.

Cheers

Chris

PS. check below relevant code:

*** index.js
// init store
var _localServer = google.gears.factory.create('beta.localserver');
var _managedStore = _localServer.createManagedStore('test');
_managedStore.manifestUrl = 'manifest.txt';
_managedStore.checkForUpdate();

var req = google.gears.factory.create('beta.httprequest');
req.open('GET', 'test.txt');
req.onreadystatechange = function() {
        if (req.readyState == 4) {
                alert(req.status);
        }
}
req.send(null);

*** manifest.txt
{
        "betaManifestVersion": 1,
        "version": "1",
        "entries": [
                { "url": ".", "redirect": "index.html" },
                { "url": "gears_init.js" },
                { "url": "index.html" },
                { "url": "index.js" }
        ]
}

*** test.txt just has :-) in it if you really wanted to know

Reply via email to