<html> <head> Testing JavaScript DHTML Functions <br> <br> <script> <!-- document.write(\q<a href="gateway-URL /portal-server-URL/index.html">write</a><BR>\q)
// 第一個規則指出 DHTML JavaScript 函數 document.write 的第一個參數需要重新寫入。Rewriter 會將第一個參數識別為一個簡單的 HTML 陳述式。在 default_gateway_ruleset 中的 HTML 規則部分具有規則 <Attribute name="href" />,此規則指出此陳述式需重新寫入。
document.writeln(\q<a href="gateway-URL /portal-server-URL/rewriter/JavaScript/functions/dhtml/index.html">writeln</a><BR>\q)
// 第二個規則指出 DHTML JavaScript 函數 document.writeln 的第一個參數需要重新寫入。Rewriter 會將第一個參數識別為一個簡單的 HTML 陳述式。在 default_gateway_ruleset 中的 HTML 規則部分具有規則 <Attribute name="href" />,此規則指出此陳述式需重新寫入。
document.write("http://abc.sesta.com/index.html<BR>") document.writeln("http://abc.sesta.com/index.html<BR>")
// 雖然 DHTML 規則識別出函數 document.write 與 document.writeln,但上述陳述式並未重新寫入。這是因為這個情況下的第一個參數並非簡單 HTML。其可能是任何字串而 Rewriter 不知如何將之重新寫入。
//--> </SCRIPT> </head> <body BGCOLOR=white> <br><br> Testing document.write and document.writeln </body> </html>