mirror of
https://github.com/jquery/jquery.git
synced 2025-01-10 18:24:24 +00:00
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
This commit is contained in:
parent
4ab8603669
commit
5a0867d1e9
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user