ajaxfileupload回到json带<pre>

前端之家收集整理的这篇文章主要介绍了ajaxfileupload回到json带<pre>前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
uploadHttpData: function( r,type ) {
        var data = !type;
        data = type == "xml" || data ? r.responseXML : r.responseText;
        // ifthe type is "script",eval it in global context
        if( type == "script" ){
         jQuery.globalEval( data );
        }

        // Get the JavaScript object,ifJSON is used.
        if( type == "json" ){
        data = jQuery.parseJSON(jQuery(data).text());
         //eval( "data = " + data );
        }

        // evaluate scripts within html
        if( type == "html" ){
         jQuery("<div>").html(data).evalScripts();
        }

        return data;
    }
原文链接:https://www.f2er.com/ajax/161276.html

猜你在找的Ajax相关文章