ajaxfiledUpload与后台配合使用,解决浏览器兼容、返回值问题

$.ajaxfiledUpload({

dataType:"json"

其他省略。。。

success:function(data){

alert(data.result);

}

});

3.后台

public String upload(){

其他省略。。。

response.setContentType( " text/plain;charset='utf-8'" );

response.getWriter().wirite( 对象转换后的 json 字符串 );

response.getWriter().flush();

}


分享到:


相關文章: