Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Animation script not working in Chrome and Safari

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #24900
    antonv
    Participant

    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

    #57853
    Stack
    Member

    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

    #57854
    antonv
    Participant

    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)
  • The forum ‘JavaScript’ is closed to new topics and replies.