简体   繁体   English

为什么我的JavaScript函数在Internet Explorer中不起作用

[英]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.

相关问题 为什么此Javascript可在Firefox中运行,但不能在Internet Explorer中运行? - Why does this Javascript work in Firefox, but not Internet Explorer? 为什么我的切换在Internet Explorer中不起作用? - Why does my toggle not work in Internet Explorer? Javascript在Internet Explorer 8中不起作用 - Javascript does not work in Internet Explorer 8 为什么我的搜索代码在Internet Explorer上不起作用 - why my search code does not work on internet explorer 为什么我的代码在本地主机上的Internet Explorer版本8上不能在服务器上运行,而在Internet Explorer版本10上却不能运行 - Why does my Code work on Internet explorer version 8 on localhost not on server, but not on internet explorer version 10 功能内部的Internet Explorer功能不起作用 - Internet Explorer Function Inside a Function Does Not Work Keydown功能在Internet Explorer 11中不起作用 - Keydown function does not work in Internet Explorer 11 为什么,== 在我的 facotrchain 函数中有效,但 === 在 Javascript 中无效 - Why does !== work in my facotrchain function, but not === in Javascript 为什么我的Javascript trim功能不起作用? - Why does my Javascript trim Function not work? Javascript图像动画在Firefox或Internet Explorer中不起作用 - Javascript Image Animation does not work in Firefox or Internet Explorer
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM