假定页的基 URL 为:
http://abc.sesta.com/page.html
页内容
<script> menu.addItem(new NavBarMenuItem("All Available Information","JavaScript:top.location=\qhttp://abc.sesta.com\q")); </script>
规则
<Function name="DJS" name="NavBarMenuItem" paramPatterns=",y"/> <Variable name="URL">top.location</Variable>
输出
<script> menu.addItem(new NavBarMenuItem("All Available Information", "JavaScript:top.location=\qgateway-URL/ http://abc.sesta.com\q")); </script>
描述
第一项规则指定需要重写函数 NavBarMenuItem 中的第二个包含 JavaScript 的参数。在 JavaScript 中,变量 top.location 也需要重写。该变量是使用第二项规则来重写的。