开发者

I.E - keypress happen all the time - jquery

开发者 https://www.devze.com 2023-04-04 20:54 出处:网络
i have a problem 开发者_如何转开发with ie, like always. check this demo with IE9 or 8: DEMO go inside the input and hit the enter, i dont know why the alert will apear.

i have a problem 开发者_如何转开发with ie, like always.

check this demo with IE9 or 8: DEMO

go inside the input and hit the enter, i dont know why the alert will apear.

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. 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.

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

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

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号