Avoid an additional javascript error in case of 404

This commit is contained in:
Nathan Gray 2013-02-06 10:47:31 +00:00
parent 7ebb83b772
commit de2c9756f1

View File

@ -61,11 +61,14 @@ function et2_loadXMLFromURL(_url, _callback, _context)
// Set the callback function // Set the callback function
xmlhttp.onreadystatechange = function() { xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4) if (xmlhttp.readyState == 4)
{
if(xmlhttp.responseXML)
{ {
var xmldoc = xmlhttp.responseXML.documentElement; var xmldoc = xmlhttp.responseXML.documentElement;
_callback.call(_context, xmldoc); _callback.call(_context, xmldoc);
} }
} }
}
// Force the browser to interpret the result as XML. overrideMimeType is // Force the browser to interpret the result as XML. overrideMimeType is
// non-standard, so we check for its existance. // non-standard, so we check for its existance.