开发者

IE8 Javascript behavior

开发者 https://www.devze.com 2023-02-16 21:02 出处:网络
wonder if anyone can help. Bascially I\'m working on a site, and a chunk of functionlity works great in all browsers apart from ie8. It doesn\'t throw an error as such. Just doesn\'t behave correctly

wonder if anyone can help.

Bascially I'm working on a site, and a chunk of functionlity works great in all browsers apart from ie8. It doesn't throw an error as such. Just doesn't behave correctly.

Bascially here; http://new.jda.co.uk/?page_id=12

if you click on any of those companies - it should bring up a lightbox which has a xml/javascript populated carousel relevant to the company clicked. In ie8 it just throws up the one company every time.

Any thoughts? I'm not fantastic at browser/j开发者_JS百科avascript debugging so I'm struggling to get to the bottom of this.

Thanks

I have looked a bit more into this; and it seems the js file is loading fine, the xml file is being written correctly - but when it comes to the parsexml function - it seems to be hanging onto the same set of data regradless of what you click;

function parsexml(){
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","write.xml",false);
xmlhttp.send();
xmlDoc=xmlhttp.responseXML;


}

As far as I can see this narrows it down to this section not reading in and updating the latest file - does the ie8 browser interpret this code differently somehow ?

Also I just checked the actual write.xml file on the server...this updates every time. If I browse to the file ie8 - it doesn't update. If I close the browser and fire up try again, it updates to the saved file !


Probably Cache issue - the file write.xml is being cached in the XMLHttpRequest somehow.

Try having:

xmlhttp.open("GET","write.xml?randNumberHere",false);

Where randNumberHere is some random number you generate.

0

精彩评论

暂无评论...
验证码 换一张
取 消