#1 楼 @guyanbiao 是返回 json 数据 #2 楼 @Rei 能触发 ajax:error,但 event 和 status 对象貌似都正常
Object {readyState: 4, getResponseHeader: function, getAllResponseHeaders: function, setRequestHeader: function, overrideMimeType: function…}
abort: function ( statusText ) {
always: function () {
complete: function () {
done: function () {
error: function () {
fail: function () {
getAllResponseHeaders: function () {
getResponseHeader: function ( key ) {
overrideMimeType: function ( type ) {
pipe: function ( /* fnDone, fnFail, fnProgress */ ) {
progress: function () {
promise: function ( obj ) {
readyState: 4
responseText: "{"succeed":true}"
setRequestHeader: function ( name, value ) {
state: function () {
status: 200
statusCode: function ( map ) {
statusText: "OK"
success: function () {
then: function ( /* fnDone, fnFail, fnProgress */ ) {
__proto__: Object
可以通过绑定 ajax:complete 来实现 ajax:success
$dom.on('ajax:complete',function(ex,e){
if(e.status == 200 && $.parseJSON(e.responseText).succeed){
//do something
}else{
alert("failed");
}
});
#8 楼 @alucardpj +1 觉得有必要提供在线视频,用优酷也不错
支持楼主,多一个选择总是好的,虽然几乎可以肯定我不会去用。。