浏览器都有怪癖模式(Quirks Mode)和标准模式(Standards Mode)。怪癖模式是为了兼容老旧的网页,去模拟早期浏览器(如 IE5.5)的非标准实现;而标准模式会尽可能的按照标准去执行。而激活不同模式的关键正是 HTML 页面的 DOCTYPE。

 

        Domino 生成的默认的 DOCTYPE 还是:

<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN”>

在目前所有流行的浏览器下它都会触发怪癖模式,问题的解决需要修改到doctype。下面是相应说明与修改方法:

/*******************这部分摘自 What’s new in Notes/Domino 7.0.2***********开始***************/

User-defined HTML tag attributes
User-defined attributes can now be added to the <HTML> tag generated by the web engine. When the field $$HTMLTagAttributes is present on a form, its contents are placed in the attribute list of the <HTML> tag. For more information, see “Additional HTML-related field attributes” in these release notes

Custom <!DOCTYPE> declaration
Users can now specify a custom <!DOCTYPE> declaration on a per form basis. When the field$$HTMLFrontMatter is present on a form, its contents will be placed in the generated HTML, ahead of the <html> tag, and the web server will not generate anything there automatically. For more information, see “Additional HTML-related field attributes” in these release notes

/*******************这部分摘自 What’s new in Notes/Domino 7.0.2***********结束***************/

可以看到新版本提供了一个表单域来控制doctype。不过,在Domino7.02后的版本中才支持这个域,在之前的版本中只能在notes.ini中添加参数:DominoCompleteDoctype解决。
具体参数值:
0 = <!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN”>

1 = <!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN” “” title=”http://www.w3.org/TR/html4/loose.dtd”>”>http://www.w3.org/TR/html4/loose.dtd”>

2 = <!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01//EN” “” title=”http://www.w3.org/TR/html4/strict.dtd”>”>http://www.w3.org/TR/html4/strict.dtd”>

 

我们只是想要触发标准模式,那么用 1 就可以了。不过由于是通过 Notes.ini 修改的,肯定会影响到所有的表单,想要更改个别的表单可以使用 $$HTMLFrontMatter 域。