Permalink
Browse files

Ajax: simplify jQuery.parseXML method

-2 bytes to the gzipped size and code looks a bit nicer

This wasn't landed to the compat branch though, since size would increase
with this cherry-pick

Closes gh-1856
  • Loading branch information...
shivajivarma authored and markelog committed Nov 12, 2014
1 parent 4ab8603 commit 5a0867d1e94794fbfc3be1f18f4c0a168dc18d95
Showing with 2 additions and 3 deletions.
  1. +2 −3 src/ajax/parseXML.js
View
@@ -4,15 +4,14 @@ define([
// Cross-browser xml parsing
jQuery.parseXML = function( data ) {
var xml, tmp;
var xml;
if ( !data || typeof data !== "string" ) {
return null;
}
// Support: IE9
try {
tmp = new DOMParser();
xml = tmp.parseFromString( data, "text/xml" );
xml = ( new DOMParser() ).parseFromString( data, "text/xml" );
} catch ( e ) {
xml = undefined;
}

0 comments on commit 5a0867d

Please sign in to comment.