溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

更改 Domino 生成 HTML 頁(yè)面的 DOCTYPE

發(fā)布時(shí)間:2020-07-30 07:46:39 來(lái)源:網(wǎng)絡(luò) 閱讀:1542 作者:liuer338 欄目:開發(fā)技術(shù)

瀏覽器都有怪癖模式(Quirks Mode)和標(biāo)準(zhǔn)模式(Standards Mode)。怪癖模式是為了兼容老舊的網(wǎng)頁(yè),去模擬早期瀏覽器(如 IE5.5)的非標(biāo)準(zhǔn)實(shí)現(xiàn);而標(biāo)準(zhǔn)模式會(huì)盡可能的按照標(biāo)準(zhǔn)去執(zhí)行。而激活不同模式的關(guān)鍵正是 HTML 頁(yè)面的 DOCTYPE。

 

        Domino 生成的默認(rèn)的 DOCTYPE 還是:

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

在目前所有流行的瀏覽器下它都會(huì)觸發(fā)怪癖模式,問題的解決需要修改到doctype。下面是相應(yīng)說(shuō)明與修改方法:

/*******************這部分摘自 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***********結(jié)束***************/

可以看到新版本提供了一個(gè)表單域來(lái)控制doctype。不過(guò),在Domino7.02后的版本中才支持這個(gè)域,在之前的版本中只能在notes.ini中添加參數(shù):DominoCompleteDoctype解決。
具體參數(shù)值:
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”>

 

我們只是想要觸發(fā)標(biāo)準(zhǔn)模式,那么用 1 就可以了。不過(guò)由于是通過(guò) Notes.ini 修改的,肯定會(huì)影響到所有的表單,想要更改個(gè)別的表單可以使用 $$HTMLFrontMatter 域。

 

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI