当页面使用<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
下,在IE7或者IE兼容模式下,使用VML可以正常显示,但是IE8标准模式下,不能正常渲染VML,导致显示不成功
可以使用如下方法:
1、设置为IE7模式 <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
2、引人相应的namespace
<?import namespace="v" implementation="#default#VML" ?>
或者
document.namespaces.add("v","urn:schemas-microsoft-
com:vml","#default#VML");
或者
if(!document.documentMode || document.documentMode<8) {
document.createStyleSheet().addRule('v\\:*', "behavior: url
(#default#VML);");
if(document.documentMode && document.documentMode>=8) {
document.writeln('<?import namespace="v"
implementation="#default#VML" ?>');
参考:
http://groups.google.com/group/google-excanvas/browse_thread/thread/8762ed1ede73509?pli=1
https://connect.microsoft.com/IE/feedback/details/333905/ie-v8-0-vml-is-no-longer-supported
http://blog.csdn.net/cuixiping/article/details/4227283
http://blog.sachinkraj.com/how-to-make-rounded-corners-in-internet-explorer-without-images/