1、不在服务器中的访问,如file:///C:/Users/yx/Desktop/index.html这样的地址,ajax是无法访问的,不会执行send();必须放到服务器才可以。
2、阻止正常提交var evt = evt || window.event; event.preventDefault();
3、jsonp当连续两次使用同一个callback的时候会冲突报错,如下:会报filightHandler is not defined
$.ajax({ type: "get", async: false, url: "#", dataType: "jsonp", jsonp: "callback", jsonpCallback:"flightHandler", success: function(json){ $.ajax({ type: "get", async: false, url: "#", dataType: "jsonp", jsonp: "callback", jsonpCallback:"flightHandler", success: function(json){ } }); } });
4、iframe中如何令父窗口刷新?self.parent.location.reload();
5、我在新项目中使用了jquery v1.10.2。在标签input中使用方法
function _checkAll(o){ if( o.checked == true ){ $('.check_all').attr('checked', true);//$('.check_all').prop('checked',true); }else{ $('.check_all').removeAttr('checked'); } }
是发现当点击第一次时可以全选,第二次时无法全选。原因为:jquery1.6中的.prop()和.attr()异同