本文實例講述了JS動態改變浏覽器標題的方法。分享給大家供大家參考,具體如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>無標題頁</title>
<link id="link1" rel="Shortcut Icon" href="1.ico" />
</head>
<body style="cursor:url(1.cur); height:100%;">
<script type="text/javascript">
var bo = true;
var title = document.title;
window.setInterval(function(){
document.title = (bo?'[信]':'[★]') + title;
bo = !bo;
},500);
</script>
設置為100毫秒時,火狐正常,IE、Chrome都不正常。
</body>
</html>
這裡注意:改變document.title的時間間隔設置為100毫秒時,火狐正常,IE、Chrome都不正常。
設置浏覽器小圖標:
<link id="link1" rel="Shortcut Icon" href="1.ico" />
改變鼠標樣式:
<body style="cursor:url(1.cur); ">
更多關於JavaScript相關內容感興趣的讀者可查看本站專題:《JavaScript+flash技巧與特效大全》、《JavaScript切換特效與技巧總結》、《JavaScript查找算法技巧總結》、《JavaScript動畫特效與技巧匯總》、《JavaScript錯誤與調試技巧總結》、《JavaScript數據結構與算法技巧總結》、《JavaScript遍歷算法與技巧總結》及《JavaScript數學運算用法總結》
希望本文所述對大家JavaScript程序設計有所幫助。