Grow your CSS skills. Land your dream job.

Animation script not working in Chrome and Safari

  • # May 20, 2009 at 2:00 pm

    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

    # May 20, 2009 at 2:23 pm

    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

    # May 20, 2009 at 2:47 pm

    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:

    Code:
    var xmlDoc=document.implementation.createDocument(“”,” “,null);
    xmlDoc.async = false;
    xmlDoc.load(xmlsrc);

    Chrome + FireFox:

    Code:
    var xmlhttp = new window.XMLHttpRequest();
    xmlhttp.open(“GET”,xmlsrc,false);
    xmlhttp.send(null);
    var xmlDoc = xmlhttp.responseXML.documentElement;

    Thanks,
    Anton

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".