ajaxfileupload 返回json解析出错 带有<pre>标签

时间:2014-12-28 10:26:58   收藏:0   阅读:1844

首先公布解决办法:

将ajaxfileupload中uploadHttpData方法里 eval( "data = " + data ); 改为 data = jQuery.parseJSON(jQuery(data).text()); 即可!


另外由于jquery版本升级,老版本中的方法弃用导致方法不存在,在ajaxfileupload中添加上此方法即可

handleError: function( s, xhr, status, e ) {
// If a local callback was specified, fire it
if ( s.error ) {
s.error.call( s.context || s, xhr, status, e );
}


// Fire the global callback
if ( s.global ) {
(s.context ? jQuery(s.context) : jQuery.event).trigger( "ajaxError", [xhr, s, e] );
}
},



好了,终于搞定了,蛋疼了一下午

原文:http://blog.csdn.net/u012730333/article/details/42211881

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!