开发者

CSS not working fine in IE9 but it works fine in all other versions [closed]

开发者 https://www.devze.com 2023-04-10 05:19 出处:网络
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical andcannot be reasonably answered in its current form. For help clari
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 11 years ago. 开发者_如何学编程

i am using jquery addRule but it is not working fine in IE9 how i can resolve this issue. any help please

check this code

var ss=document.createStyleSheet();
ss.insertRule("v\\:shape", "behavior:url(#default#VML);")


jQuery does not have an .addRule() method. Only >IE9 supports the addRule method.

You should be using insertRule instead.

Edit: In fact, you should check for both as IE8 and below do not support insertRule:

if (stylesheet.insertRule) {
  // all except IE < 9
} else if (stylesheet.addRule) {
  // IE < 9
}

Assuming stylesheet is your stylesheet object.

0

精彩评论

暂无评论...
验证码 换一张
取 消