删除并添加不在FF中工作的类
问题描述:
$('#resTable .wsButton').each(function() {
if ($(this).hasClass("btPrimary")) {
$(this).removeAttr("href");
$(this).removeClass("btPrimary");
$(this).addClass("btPrimaryPrint");
}
});
此代码在IE中工作,但不在FF中。 我做错了什么?删除并添加不在FF中工作的类
答
多德只是更换您的第一线
$(document).ready(function(){
//your code here
});
它应该工作
+0
这个没有工作 – RRForUI 2011-04-29 09:48:50
答
把你的代码:
$('#resTable, .wsButton').each
+0
它已经在$(document).ready(function(){。在IE中工作,但是在NT中工作FF – RRForUI 2011-04-29 09:49:55
答
我找到了类似的错误,但它得到解决时,我不停的事件处理方法(文件)外。就绪的方法,因为它是装载在页面重新加载,而不是在特定的事件。 我希望我很清楚
$(document).ready(function(){
});
//your code
你怎么知道它是否工作? – Jon 2011-04-29 09:47:41
它适合我。我可以看到你的HTML代码吗? http://jsfiddle.net/ynhat/mSNjw/1/ – YNhat 2011-04-29 09:53:21
它的工作原理,请参阅我的回答 – 2011-04-29 09:56:38