MCPcopy
hub / github.com/moxiecode/plupload / _getDocument

Function _getDocument

js/moxie.js:7967–7986  ·  view source on GitHub ↗
(xhr)

Source from the content-addressed store, hash-verified

7965
7966 // @credits Sergey Ilinsky (http://www.ilinsky.com/)
7967 function _getDocument(xhr) {
7968 var rXML = xhr.responseXML;
7969 var rText = xhr.responseText;
7970
7971 // Try parsing responseText (@see: http://www.ilinsky.com/articles/XMLHttpRequest/#bugs-ie-responseXML-content-type)
7972 if (Env.browser === 'IE' && rText && rXML && !rXML.documentElement && /[^\/]+\/[^\+]+\+xml/.test(xhr.getResponseHeader("Content-Type"))) {
7973 rXML = new window.ActiveXObject("Microsoft.XMLDOM");
7974 rXML.async = false;
7975 rXML.validateOnParse = false;
7976 rXML.loadXML(rText);
7977 }
7978
7979 // Check if there is no error in document
7980 if (rXML) {
7981 if ((Env.browser === 'IE' && rXML.parseError !== 0) || !rXML.documentElement || rXML.documentElement.tagName === "parsererror") {
7982 return null;
7983 }
7984 }
7985 return rXML;
7986 }
7987
7988
7989 function _prepareMultipart(fd) {

Callers 1

XMLHttpRequestFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected