diff options
author | Rick Waldron <waldron.rick@gmail.com> | 2012-12-17 17:41:38 -0500 |
---|---|---|
committer | Rick Waldron <waldron.rick@gmail.com> | 2012-12-26 13:34:37 -0500 |
commit | 155dbad029e001f4752a4aedc901cf950ebfe64d (patch) | |
tree | a9d6fad01a71d0be03429210cfde070180d20d07 /src/core.js | |
parent | 338eaf6181f4078553dc2453ffe3bd73ab2478eb (diff) | |
download | jquery-155dbad029e001f4752a4aedc901cf950ebfe64d.tar.gz jquery-155dbad029e001f4752a4aedc901cf950ebfe64d.zip |
2.0: Reduced parseXML
Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
Diffstat (limited to 'src/core.js')
-rw-r--r-- | src/core.js | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/core.js b/src/core.js index 96a68c2e6..55ed4317f 100644 --- a/src/core.js +++ b/src/core.js @@ -486,19 +486,16 @@ jQuery.extend({ if ( !data || typeof data !== "string" ) { return null; } + + // IE9 will throw on ill-formed XML try { - if ( window.DOMParser ) { // Standard - tmp = new DOMParser(); - xml = tmp.parseFromString( data , "text/xml" ); - } else { // IE - xml = new ActiveXObject( "Microsoft.XMLDOM" ); - xml.async = "false"; - xml.loadXML( data ); - } - } catch( e ) { + tmp = new DOMParser(); + xml = tmp.parseFromString( data , "text/xml" ); + } catch ( e ) { xml = undefined; } - if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) { + + if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) { jQuery.error( "Invalid XML: " + data ); } return xml; |