daily pastebin goal
75%
SHARE
TWEET

Untitled

a guest May 20th, 2018 84 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (function($){
  2.   if(typeof DOMParser === 'undefined')return;
  3.   var _httpData = $.httpData;
  4.   $.httpData = function( xhr, type, s ) {
  5.         var ct = xhr.getResponseHeader("content-type"),
  6.     xml = type == "xml" || !type && ct && ct.indexOf("xml") >= 0,
  7.     data = xml ? xhr.responseXML : xhr.responseText;
  8.     if(!xml || data){
  9.       return _httpData( xhr, type, s );
  10.     }
  11.     data = new DOMParser().parseFromString(xhr.responseText, "text/xml");
  12.     if (data.documentElement.tagName == 'parsererror'){
  13.       throw 'parsererror';
  14.     }
  15.     return data;
  16.   };
  17. })
  18. (jQuery);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top