fwahlqvist / simile-widgets

Automatically exported from code.google.com/p/simile-widgets
0 stars 0 forks source link

TIMELINE: Safari and null XML document #32

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What is the expected output? What do you see instead?

Was expecting events to be loaded but weren't.  Is more a Safari issue as
it worked in all other browsers, as I've checked the document Content-Type
header and it was set to application/xml.

What version of the product are you using? On what operating system?

Please provide any additional information below.

I've have modified the JavaScript on my version as follows:

Timeline.loadXML = function(url, f) {
    var fError = function(statusText, status, xmlhttp) {
        alert("Failed to load data xml from " + url + "\n" + statusText);
    };
    var fDone = function(xmlhttp) {
        var xml = xmlhttp.responseXML;
        if (!xml && xmlhttp.responseText)
        {
            try
            {
                xml = ((new DOMParser())).parseFromString(xmlhttp.responseText,
"application/xml");
            }
            catch (e)
            {
                alert('failed to load document');
                return;
            }
        }
        if (!xml.documentElement && xmlhttp.responseStream) {
            xml.load(xmlhttp.responseStream);
        } 
        f(xml, url);
    };
    try
    {
        Timeline.XmlHttp.get(url, fError, fDone);
    } catch(e){}
};

basically, if xml is null, will try to load from the responseText, failing
if that doesn't happen

Original issue reported on code.google.com by stu.me...@gmail.com on 14 Oct 2008 at 1:04

GoogleCodeExporter commented 9 years ago

Original comment by larryklu...@gmail.com on 26 Oct 2008 at 8:43

GoogleCodeExporter commented 9 years ago

Original comment by stefano.mazzocchi@gmail.com on 25 Mar 2009 at 7:01