ie8
var $ = document.createElement("v:group");
$.style.left = this.x;
$.style.top = this.y;
$.style.width = this.w;
$.style.height = this.h;
$.setAttribute("coordsize", this.w + "," + this.h);
this.el = $;
var B = document.createElement("v:roundrect");
B.style.position = "absolute";
B.style.left = "5px";
B.style.top = "5px";
B.style.width = (this.w - 10) + "px";
B.style.height = (this.h - 10) + "px";
B.setAttribute("id", Gef.id());
B.setAttribute("arcsize", 0.2);
B.setAttribute("fillcolor", "#F6F7FF");
B.setAttribute("strokecolor", "#03689A");
B.setAttribute("strokeweight", "2");
B.style.verticalAlign = "middle";
<span style="color:#FF0000;">$.appendChild(B);</span>一直报错“意外地调用了方法或属性访问”,浪费了好长时间也解决不了。此功能使用vml画图,对此我又知之甚少,问题又亟待解决。后来有一方法 ,HTML头部改为:
<html xmlns:v="urn:schemeas-microsoft-com:vml">就好了。
xmlns:v="urn:schemas-microsoft-com:vml" 这句在html文档中,可写,可不写!但在xhtml文档中必须写。它的作用是在文档中定义一个或多个可供选择的命名空间。先记录一下,后续再补充。xmlns:v是html的属性,它定义了一个命名空间,浏览器会将此命名空间用于该属性所在元素内的所有内容。
在IE8浏览器中,使用appendChild方法时遇到了意料之外的问题,该问题导致了方法或属性访问的错误。详细讨论了这个兼容性问题及其解决策略。
455

被折叠的 条评论
为什么被折叠?



