<html> <head> 
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"> 
<TITLE>改变标题栏 </TITLE> 
</head> 
<body>
<SCRIPT> 
var s=0;//============
var g_blinktitle = document.title; 
var t=setTimeout("shinetitle()", 1000); 
function shinetitle(con){ //=============
if (s>3) clearTimeout(t); 
document.title = s % 2 ? "【  】 - " + g_blinktitle : "【"+con+"】 - " + g_blinktitle; 
s++; 
if(s <3) setTimeout("shinetitle('"+con+"')", 1000); //==========

</SCRIPT> <input type=submit onclick='javascript:shinetitle("aaaa")'> </body> </html>

解决方案 »

  1.   

    <SCRIPT>
    var g_blinktitle = document.title;function shinetitle(con,s){
    if(s>3)return;
    else
    {
    document.title = s % 2 ? "【  】 - " + g_blinktitle : "【"+con+"】 - " + g_blinktitle;
    s++;
     t = setTimeout("shinetitle('"+con+"','"+s+"')", 1000);
    }
     
    }
    </SCRIPT> 
      

  2.   

    <html> <head> 
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> 
    <TITLE>改变标题栏 </TITLE> 
    </head> 
    <body>
    <SCRIPT> 
    var s=0;
    var g_blinktitle = document.title; 
    var t=setTimeout("shinetitle('test')", 1000); 
    function shinetitle(con){ 
    if (s>=3){s=0; clearTimeout(t); }//重置s
    document.title = s % 2 ? "【  】 - " + g_blinktitle : "【"+con+"】 - " + g_blinktitle; 
    s++; 
    if(s <3) setTimeout("shinetitle('"+con+"')", 1000); 

    </SCRIPT> <input type=submit onclick='javascript:shinetitle("aaaa")'> </body> </html>