面向对象的Javascript代码在IE7中不起作用
Object Oriented Javascript code not working in IE7
我有以下代码。
function radioButtons() {
var _inputCount;
var _inputParentCount;
var _radioInput;
return {
inputCounter:function(groupId){
_inputCount = $(groupId).find("input");
_inputParentCount = $(_inputCount).parent();
for(i = 0; i < _inputParentCount.length; i++){
$(_inputParentCount[i]).attr("id", groupId + [i]);
}
},
radioAction:function(radioButton){
_radioInput = $(radioButton).find("input");
for(i = 0; i < _inputCount.length; i ++){
$(_inputCount[i]).parent().removeClass("selected");
$(_inputCount[i]).attr("value", "false");
}
$(radioButton).addClass("selected");
$(_radioInput).attr("value", "true");
},
};
};
var radioButtonsOne = new radioButtons();
$(document).ready(function(){
radioButtonsOne.inputCounter("#radioButtonsGroup");
});
这是我为自定义单选按钮编写的自定义函数。我有一个类似的复选框按钮。它在除IE7之外的所有浏览器中都能完美工作。它告诉我radioButtonsOne
没有定义。但事实的确如此。知道为什么吗?
谢谢!
更改
$(radioButton).addClass("selected");
$(_radioInput).attr("value", "true");
},
移除,
$(radioButton).addClass("selected");
$(_radioInput).attr("value", "true");
}
相关文章:
- Recaptcha在IE7和IE8中不起作用
- 面向对象的Javascript代码在IE7中不起作用
- jQuery函数在IE7中不起作用
- javascript/jquery选项卡在IE7、8或9中不起作用
- 在使用JavaScript的IE7/8中,数组上的.indexOf函数不起作用
- 使用onsubmit函数的Javascript验证在IE8和IE7中不起作用
- 在IE7中,两个函数在window.onload中不起作用
- Posted Flash on Wall (FB.ui js SDK),在IE7/8和Opera中不起作用
- Javascript SDK 在 Facebook Canvas App IE7/8 中不起作用
- .live() 中的 jQuery .select() 在 IE7 和 IE8 上不起作用
- ExCanvas 在 IE7 和 IE8 IFrame 中不起作用
- JQuery 显示/隐藏不起作用的 IE7
- jQuery fancybox 在 IE7 中不起作用
- offset().top 在 IE7 中不起作用
- jQuery Unobposive 在 IE7 或 IE8 中不起作用
- Jquery IE7(:“可见”)验证器不起作用
- j查询数量(输入值)+ / - 按钮在IE7上不起作用
- 为什么使用 insertBefore() 将元素从友好的 iframe 中提取出来在 IE7 中不起作用
- 为什么这个javascript函数在ie7和8上不起作用
- setAttribute 在 IE7 中不起作用