Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function($){
- if(typeof DOMParser === 'undefined')return;
- var _httpData = $.httpData;
- $.httpData = function( xhr, type, s ) {
- var ct = xhr.getResponseHeader("content-type"),
- xml = type == "xml" || !type && ct && ct.indexOf("xml") >= 0,
- data = xml ? xhr.responseXML : xhr.responseText;
- if(!xml || data){
- return _httpData( xhr, type, s );
- }
- data = new DOMParser().parseFromString(xhr.responseText, "text/xml");
- if (data.documentElement.tagName == 'parsererror'){
- throw 'parsererror';
- }
- return data;
- };
- })
- (jQuery);
Add Comment
Please, Sign In to add comment