IE下自定义标签的问题
大猫钓鱼 2006-10-15 02:36:22 以前没注意,刚发现的,具体如下:
我自定义了一组标签
<menu:tab>
<menu:panel>
<menu:pad>
...
在FF或Opera下无须改动命名空间,直接用:
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh-CN">
就可以通过
但在IE下,如果照上面的写,自定义标签根本没有加载样式!
于是便有了:
<html xmlns:menu="http://www.w3.org/1999/xhtml" lang="zh-CN">
但这种写法不符合http://www.w3.org/1999/xhtml命名空间下的文档声明,我在http://validator.w3.org/check?uri=referer测试了一下,唯独这个错误解决不了,不知道有没有兄弟知道怎么做?
附错误详细信息:
<html xmlns:menu="http://www.w3.org/1999/xhtml" lang="zh-CN">
You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead).
This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information.
How to fix: check the spelling and case of the element and attribute, (Remember XHTML is all lower-case) and/or check that they are both allowed in the chosen document type, and/or use CSS instead of this attribute.
其实也不是什么致命问题,只是有些好奇,我在想,javascript里能不能动态加载xmlns,如果这样就可以骗过validator.w3.org的验证了^_^