Nir
Nir

Reputation: 1

xmlhttp.send throws exception while using manifest file

I have a weird problem on Chrome and MobileSafari (works great on IE9)

I have the following code: var products;

function init()
    {
            var xmlhttp;
            if (window.XMLHttpRequest)
              {// code for IE7+, Firefox, Chrome, Opera, Safari
              xmlhttp=new XMLHttpRequest();
              }
            else
              {// code for IE6, IE5
              xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
              }

            xmlhttp.open("GET","ipad/products.php",false);
            xmlhttp.send();
            products = JSON.parse(xmlhttp.responseText);
            //alert(products.products[0].title);
            getProduct(1);
    }

init is called by body onload function.

In addition, I use manifest to cache some files:

<HTML manifest="manifest.php">

now, when I visit the page for the first time - everything works great. after a refresh xmlhttp.send() throws "NETWORK_ERR: XMLHttpRequest Exception 101"

in order to view the page normally again I need to clean the browser cache

removing the manifest file solves the problem but I need it for offline browsing.

anyone knows what is wrong?

Thanks

Upvotes: 0

Views: 538

Answers (1)

Nir
Nir

Reputation: 11

well, I solved the problem by adding the following line to manifest.php:

NETWORK: *

now everything works I guees that the main page was cached too and that caused some problems. on IE it works because it doesn't support manifest files

Upvotes: 1

Related Questions