简体   繁体   English

IE-按键事件一直发生-jQuery

[英]I.E - keypress happen all the time - jquery

i have a problem with ie, like always. 我有一个问题,即像往常一样。

check this demo with IE9 or 8: DEMO 使用IE9或8检查此演示: DEMO

go inside the input and hit the enter , i dont know why the alert will apear. 进入输入,然后按Enter ,我不知道为什么会出现警报。

bug ? 错误?

    // the button
    $("#client").live("click", function(){
       alert('test'); 
    });

   // the input text
   $("#pesq_model").live("keypress", function(e){
       // testing with nothing 
   });

IE treats button tags in a special way. IE以特殊方式处理button标记。 You could use an input instead of a button: 您可以使用输入而不是按钮:

<input type="button" style="border: solid #dedede 2px; width:130px;" id="client" value="Trocar Cliente" />

Demo . 演示

You should use $('#form_id').live("submit", {...}) instead, I think. 我认为应该改用$('#form_id').live("submit", {...})

http://jsfiddle.net/C5Jzw/4/ http://jsfiddle.net/C5Jzw/4/

$("#form_id").live("submit", function() {
    alert('teste');
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 预期为“;” IE中的异常(JavaScript,jQuery) - Expected ';' exception in I.E (JavaScript, jQuery) Firefox和IE中的Jquery问题,但Chrome中没有 - Jquery issue in Firefox and I.e but not Chrome 如何在使用“全选”运算符(即“ *”)和jquery时获得点击元素? - how to get clicked element while using “select all” operator i.e “ * ” using jquery? 仅在Wordpress中删除IE上的所有CSS动画 - Remove all CSS animations on I.E only in Wordpress 无法读取带有IE的jQuery加载的属性值 - Can't read attribute value loaded by jQuery with i.e jQuery.focus在IE 11中不起作用 - jQuery.focus not working in I.E 11 如何在所有设备(例如台式机和移动浏览器)上制作具有一定高度和100%宽度的iframe - how to make an iframe with some height and 100% width across all devices i.e desktop and mobile browsers jQuery:如何覆盖特定元素的默认方法(即html,append)? - jQuery: how to override default methods (i.e html, append) for particular element? 如何在 jquery 中的 keyup() 上比较手机号码的第一个字母,即 0 或不 - How to compare first letter of a mobile number i.e 0 or not on keyup() in jquery jQuery滚动到BOTTOM以加载新内容在Scrolling TOP上以相反的方式工作(即) - Jquery Scroll to BOTTOM to load new content is working in opposite way (i.e) on Scrolling TOP
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM