summaryrefslogtreecommitdiff
path: root/bower_components/jquery/src/ajax/parseXML.js
diff options
context:
space:
mode:
authorThomas Park <thomas@thomaspark.me>2014-11-01 21:05:20 -0400
committerThomas Park <thomas@thomaspark.me>2014-11-01 21:05:20 -0400
commit918b2a49ca6ac074bac47f6685cf3a687a4c6212 (patch)
tree5d11a2820c6e0726a6ee071724557d12a90c6709 /bower_components/jquery/src/ajax/parseXML.js
parent5c12c8a99c04fbff7d13e97679121a5de13e01d6 (diff)
3.2.0 -> 3.3.0
Diffstat (limited to 'bower_components/jquery/src/ajax/parseXML.js')
-rw-r--r--bower_components/jquery/src/ajax/parseXML.js28
1 files changed, 28 insertions, 0 deletions
diff --git a/bower_components/jquery/src/ajax/parseXML.js b/bower_components/jquery/src/ajax/parseXML.js
new file mode 100644
index 00000000..9eeb625f
--- /dev/null
+++ b/bower_components/jquery/src/ajax/parseXML.js
@@ -0,0 +1,28 @@
+define([
+ "../core"
+], function( jQuery ) {
+
+// Cross-browser xml parsing
+jQuery.parseXML = function( data ) {
+ var xml, tmp;
+ if ( !data || typeof data !== "string" ) {
+ return null;
+ }
+
+ // Support: IE9
+ try {
+ tmp = new DOMParser();
+ xml = tmp.parseFromString( data, "text/xml" );
+ } catch ( e ) {
+ xml = undefined;
+ }
+
+ if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) {
+ jQuery.error( "Invalid XML: " + data );
+ }
+ return xml;
+};
+
+return jQuery.parseXML;
+
+});