[英]Why does my javascript function not work in Internet explorer
This is my JavaScript function. 这是我的JavaScript函数。 It's nested in a document.ready function() 它嵌套在document.ready function()中
$(".bim").change(function() {
var str = "";
$("input:checked").each(function() {
str += $(this).next().text() + "_";
});
str = str.substr(0, str.length - 1);
alert(str);
});
It works fine in Firefox and Chrome. 它在Firefox和Chrome中正常运行。
It DOES NOT work with IE8 and IE6 它不适用于IE8和IE6
I'm very new to javascript and help would be much appreciated 我对javascript非常陌生,将不胜感激帮助
Use the jQuery 1.4.2 which fixed several issues with the .change()
method for IE 使用jQuery 1.4.2修复了IE的.change()
方法的几个问题
See Related issue Also here on Stackoverflow 另请参见相关问题关于Stackoverflow
Internet Explorer does not support the
:checked
pseudo class (and neither does Sizzle IIRC).
Internet Explorer不支持
:checked
伪类(Sizzle IIRC也不支持)。
Internet Explorer doesn't support :checked:
, but as bobince pointed out, it will fall back to Sizzle, which does in fact support :checked
. Internet Explorer不支持:checked:
:,但是正如bobince指出的那样,它将退回到Sizzle,它实际上支持:checked
。
What version of Internet Explorer are you using? 您正在使用哪个版本的Internet Explorer?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.