treehouse : what would you like to learn today?
Web Design Web Development iOS Development

Animation script not working in Chrome and Safari

  • Hi all,

    I am pretty new to javascript and i customized an animation script to fit my needs. It all works fine in FF and IE but i just noticed the it doesn't work on Chrome and the iPhone which is Safari if i'm not mistaken. Any ideas why it's not working on those browsers?

    Here is the url: http://socalscubainfo.com/global-swell- ... direction/

    Thanks,
    Anton
  • Can you post an example of the script so we can take a look at it? u got a ton of scripts linked on that page and dont feel like lookin through all of em :p
  • I figured it out. I was all about the way chrome and safari do an http request. Here is the post that i found with the explanation: http://chromespot.com/showthread.php?t=1063

    And here is the code change:
    FireFox only:

    var xmlDoc=document.implementation.createDocument(\"\",\" \",null);
    xmlDoc.async = false;
    xmlDoc.load(xmlsrc);


    Chrome + FireFox:

    var xmlhttp = new window.XMLHttpRequest();
    xmlhttp.open(\"GET\",xmlsrc,false);
    xmlhttp.send(null);
    var xmlDoc = xmlhttp.responseXML.documentElement;


    Thanks,
    Anton