Ajax IE7 cache problem

Discussion in 'JavaScript' started by Bedrock9, Feb 10, 2010.

  1. #1
    Hi thanks for any help,

    I have built a PHP script triggered by a select drop menu to return a set of products from my database,

    However after many failed attempts I noticed that what I had tried works fine in Chrome but not in IE7, and I am guessing it is to do with the Chaching problems experienced with IE.

    My Ajax script has been borrowed from a tutorial and I think the random number generator which should prevent caching problems is deffective, heres the code

    var url="wfdmort.php";
    url=url+"?q="+str;
    url=url+"&sid="+Math.random();
    xmlhttp.onreadystatechange=stateChanged;
    xmlhttp.open("GET",url,true);
    xmlhttp.send(null);

    Can anyone spot the problem? I think it is to do with url=url+ etc etc but am a bit stuck! Thanks
     
    Bedrock9, Feb 10, 2010 IP