diff options
author | Shivaji Varma <contact@shivajivarma.com> | 2014-11-12 15:59:41 +0530 |
---|---|---|
committer | Oleg Gaidarenko <markelog@gmail.com> | 2014-12-25 08:24:37 +0300 |
commit | 5a0867d1e94794fbfc3be1f18f4c0a168dc18d95 (patch) | |
tree | ba85b0d5b71f57dae2b2ebb64dc8b2ea4fe6bb72 /src | |
parent | 4ab8603669e2bbc8644e402927c33ce422d7aaa3 (diff) | |
download | jquery-5a0867d1e94794fbfc3be1f18f4c0a168dc18d95.tar.gz jquery-5a0867d1e94794fbfc3be1f18f4c0a168dc18d95.zip |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/ajax/parseXML.js | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/ajax/parseXML.js b/src/ajax/parseXML.js index 9eeb625ff..6a40c854a 100644 --- a/src/ajax/parseXML.js +++ b/src/ajax/parseXML.js @@ -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; } |