现场活动在ie7中不起作用? [英] live event not works in ie7?

查看:69
本文介绍了现场活动在ie7中不起作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过ajax显示复选框,点击该复选框后我触发了事件。它在所有浏览器中都存在但在ie7中它不起作用。我点击复选框没有任何反应。我的示例代码。

  $(#checkbox_id)。live('change',function(){
alert('check ');
});


解决方案

IE7 不支持更改实时事件(即 $(#checkbox_id).live('change',function(){})



<请记住,一旦在ajax中显示html代码,特别是复选框实时更改事件将无法在ie7中运行。使用 $('#checkbox_id')。live('click',function(){}); 用于ajax复选框事件触发。



我的回答可能有助于遇到同样问题的人


I am displaying checkbox via ajax and i had triggered event when clicking that check box. It wrks in all browser but in ie7 it not works. i clicked on check box nothing happened. my sample code.

$("#checkbox_id").live('change',function(){
    alert('check');
});

解决方案

IE7 Wont supports change event in live (i.e $(#checkbox_id).live('change', function(){}))

Remember once html code displayed in ajax particularly for checkbox live change event wont works in ie7. Use $('#checkbox_id').live('click',function(){}); for ajax checkbox event triggering.

My answer might help some one who face same problem

这篇关于现场活动在ie7中不起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆