內建Behavior的應用:HomePAge篇 "homepage"用來瀏覽或改變首頁,有三種內建的方法。其一:"ishomepage"會檢查指定的網址 ,如果是系統默認的首頁,其二:"sethomepage"會將指定的網頁,設定成系統默認的首頁。 其三:"navigatehomepage",就是常用的"回到首頁"。本例介紹第一種方法,其它就不再多講了 xmllover.htm <html xmlns:ie> <head> <title>xmllover</title> <Script> function check() {str1=my_tag.ishomepage(page1.value); alert(Str1);} </script> </head>
<body> <ie tag1 id="my_tag" style=behavior:url(#default#homepage)"/> <input type="text" id="page1" style="font-size:18" value="其它html文件"> <p> <input type="type="button" value="click me" onclick="check()"> </p> </body> </html>
|