Event.observe'更改'事件未在IE中触发 [英] Event.observe 'change' events not being triggered in IE

查看:232
本文介绍了Event.observe'更改'事件未在IE中触发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  Event.observe(' use_billing','change',Checkout.getBillingData); 

这在Firefox(当然)中工作正常,但IE(当然)中没有任何反应 - 已经有一段时间的谷歌搜索,但是我还没有找到一个合适的解决方案来解决这个问题。我看到有问题,但是我发现没有什么可以规避这个问题,让这个工作。



我真的试图避免使用内联事件触发器,因为它们是令人困惑的是让一个容易出错的垃圾文档:

 < select id ='use_billing'onchange =Checkout.getBillingData );> ....< /选择> 

任何想法都会很棒 - 这是停止这个项目从beta到生产的唯一办法。

解决方案

我发现原因 - 这不是焦点问题,事实证明,我有表单元素的名称和id值相同 - 我更改了id值,一切正常。


The Prototype event listener I use for changes in select menus is not being triggered in IE.

Event.observe('use_billing', 'change', Checkout.getBillingData);

This works fine in Firefox (of course), but nothing happens in IE (of course) - I've been Googling this for some time, but I have not found a suitable solution to this problem. I read there are problems, but I found nothing useful to circumvent the issue and get this to work.

I am really trying to avoid using inline event triggers, because they are obtrusive and make for a messy document prone to errors:

<select id='use_billing' onchange="Checkout.getBillingData();">....</select>

Any ideas would be great - this is the only thing stopping this project from going from beta to production.

解决方案

I found the reason - it wasn't the focus issue, it turns out that I had the form element's name and id values the same - I changed the id value and everything worked fine.

这篇关于Event.observe'更改'事件未在IE中触发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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