jQuery事件在Firefox中运行,而不是Chrome [英] jQuery events work in Firefox, not Chrome

查看:182
本文介绍了jQuery事件在Firefox中运行,而不是Chrome的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在代码中注册了一些点击事件。它们在Firefox(Windows和Mac)中正常工作,但不在Chrome中执行(尝试过Windows和Mac beta)。

JavaScript的目的是显示正确的

这里是代码:
http://www.savetherobots.org/users/jkost/substitutioncipher.php



根据 Firebug ,脚本没有bug。代码有问题吗?

解决方案

Hai,



选择框,您需要为更改事件而不是点击事件注册处理程序。 Firefox和IE使用click事件很奇怪。



看看这个


jQuery Click事件没有在Safari中被触发?

>

I registered some click events in my code. They function properly in Firefox (Windows and Mac) but don't execute in Chrome (tried Windows and Mac beta).

The purpose of the JavaScript is to show the correct number of text inputs based on the value of the select element.

Here is the code: http://www.savetherobots.org/users/jkost/substitutioncipher.php

The script is bug-free according to Firebug. Is something wrong with the code?

解决方案

Hai ,

For Select boxes, you need to register a handler for a "change" event rather than a "click" event. It's strange that Firefox and IE work with the click event.

Have a look at this Click event on select option element in chrome

and JQuery Click event not being triggered in Safari?

这篇关于jQuery事件在Firefox中运行,而不是Chrome的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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