jquery quirks

阎修明
2023-12-01

1.FileReader对象只支持DOM level 1 的某些事件。例如如下onprogress 事件,.bind(), .on()的handler的被传入事件均没有某些属性(dataTransfer, lengthComputable, etc.)的值;(jquery-1.9.1.js)

var reader = new FileReader;
function ccc (evt){
console.log((evt.lengthComputable, evt.loaded, evt.total); 
}
}
r.onprogress = ccc;  //正常输出lengthComputable, loaded, total的值;
//$(r).on("progress", ccc); //this evt's lengthComputable,total,loaded are undefined! same effect on .bind();
2. jquery treat $(input).attr('checked') and $(input)[0].checked differently; pay attend to the several built-in property of DOM element. e.g. id, class, checked, etc.

3. ajax callback will failed  silently without the error tip output by the console, if the sent back data is not formal json, e.g. { result: "ok" }, it  must be formal json: { "result": "ok" }



 类似资料:

相关阅读

相关文章

相关问答