您可自下列路徑存取此範例:
portal-server-URL /rewriter/JavaScript/functions/url/url.html
將此範例中指定的規則新增 (若尚不存在) 至 [重新寫入 JavaScript 來源的規則] 部分的 default_gateway_ruleset 中。在 Portal Server 管理主控台的 Portal Server 配置下,編輯 Rewriter 服務中的 default_gateway_ruleset。
重新啟動閘道:
./psadmin start-sra-instance –u amadmin – f <password file> –N <profile name>– t <gateway> |
<html> <body> JavaScript URL Function Test Page <br> <script language="JavaScript"> <!-- function test(one,two,three) { alert(one + "##" + two + "##" +three); } test("/test.html","../test.html","123"); window.open("/index.html","gen",width=500,height=500); //--> </SCRIPT> </body> </html>
<Function type="URL" name="test" paramPatterns="y,y"/> <Function type="URL" name="window.open" paramPatterns="y"/>
<html> <body> JavaScript URL Function Test Page <br> <script language="JavaScript"> <!-- function test(one,two,three) { alert(one + "##" + two + "##" +three); } test("/test.html","../test.html","123"); window.open("gateway-URL/portal-server-URL /index.html","gen",width=500,height=500); //--> </SCRIPT> </body> </html>