aboutsummaryrefslogtreecommitdiff
path: root/node_modules/jquery/src/ajax/parseXML.js
diff options
context:
space:
mode:
authornanalelfe <nargiza.nosirova@mail.utoronto.ca>2016-07-25 03:14:34 +0000
committernanalelfe <nargiza.nosirova@mail.utoronto.ca>2016-07-25 03:14:34 +0000
commit34f553940cd5e9fba5ca6062333f42ba741b700a (patch)
treed806ac66b323e688dcf09ba78a197ab41b4bcb5a /node_modules/jquery/src/ajax/parseXML.js
parent482401fa5777b910b099f96b0abdadf1d4cfa54c (diff)
Fixed /send_message error/success message show up.
Diffstat (limited to 'node_modules/jquery/src/ajax/parseXML.js')
-rw-r--r--node_modules/jquery/src/ajax/parseXML.js30
1 files changed, 30 insertions, 0 deletions
diff --git a/node_modules/jquery/src/ajax/parseXML.js b/node_modules/jquery/src/ajax/parseXML.js
new file mode 100644
index 0000000..acf7ab2
--- /dev/null
+++ b/node_modules/jquery/src/ajax/parseXML.js
@@ -0,0 +1,30 @@
+define( [
+ "../core"
+], function( jQuery ) {
+
+"use strict";
+
+// Cross-browser xml parsing
+jQuery.parseXML = function( data ) {
+ var xml;
+ if ( !data || typeof data !== "string" ) {
+ return null;
+ }
+
+ // Support: IE 9 - 11 only
+ // IE throws on parseFromString with invalid input.
+ try {
+ xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" );
+ } catch ( e ) {
+ xml = undefined;
+ }
+
+ if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) {
+ jQuery.error( "Invalid XML: " + data );
+ }
+ return xml;
+};
+
+return jQuery.parseXML;
+
+} );