document.title="Hi!Title"
window.status="Hi!Status"
[Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]
firefox 是因为默认不允许改变状态栏文字,需要修改设置 tools / options / content / advanced

opera是因为不完整的html缘故,所以找不到title,:(
document.title="Hi!Title"
[Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]
for ie & opera no firefox
/*
Animated Document title- By Dynamicdrive.com
For full source, TOS, and 100s DTHML scripts
Visit http://dynamicdrive.com
*/
if (document.all||document.getElementById){
var thetitle=document.title
document.title=''
}
////Animation code below
////based on script from http://wsabstract.com/script/script2/statusanimate.shtml
var data="0123456789";
var done=1;
function statusIn(text){
decrypt(text,2,1);
}
function statusOut(){
self.status='';
done=1;
}
//-------------------------\
//decrypt(string, int, int)\
//-------------------------\
//
//text(string): the text to be decrypted on
//the status bar.
//
//max(int): the number of times a random string
//is displayed before the next character is
//'decrypted'.
//
//delay(int): the number of milliseconds between
//each display of a random string
//
//Example:
//decrypt('Enter my site.',10,10);
//
//text = 'Enter my site.' :: 'Enter my site.' is
//eventually decrypted
//
//max = 10 :: a different random string is dis-
//played 10 times before a new character is
//decrypted
function decrypt(text, max, delay){
if (done){
done = 0;
decrypt_helper(text, max, delay, 0, max);
}
}
function decrypt_helper(text, runs_left, delay, charvar, max){
if (!done){
runs_left = runs_left - 1;
var status = text.substring(0,charvar);
for(var current_char = charvar; current_char < text.length; current_char++){
status += data.charAt(Math.round(Math.random()*data.length));
}
document.title = status;
var rerun = "decrypt_helper('" + text + "'," + runs_left + "," + delay + "," + charvar + "," + max + ");"
var new_char = charvar + 1;
var next_char = "decrypt_helper('" + text + "'," + max + "," + delay + "," + new_char + "," + max + ");"
if(runs_left > 0){
setTimeout(rerun, delay);
}
else{
if (charvar < text.length){
setTimeout(next_char, Math.round(delay*(charvar+3)/(charvar+1)));
}
else
{
done = 1;
}
}
}
}
//if IE 4+ or NS 6+
if (document.all||document.getElementById)
statusIn(thetitle)
[Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]
from:
http://www.dynamicdrive.com/dynamicindex11/animatedtitle.htm
IE 有 window.event 对象,所以
document.onmousemove = function(e){document.title="x:"+window.event.clientX}
[Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]
firefox 使用下面方法
document.onmousemove = function(e){document.title="x:"+e.clientX}
[Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]
综合起来如下:
function doStuff(e) // note: takes the event as an arg (IE doesn't)
{
if (!e) e = window.event; // fix IE
// do some stuff with the event..
document.title="x:"+e.clientX
/*
I think that the x and y properties are
non-standard too, I could be wrong
though (wouldn't be the first time ;))
*/
}
document.onmousemove = doStuff;
[Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]
比如地址栏执行:
javascript:void 0;keyit=window.open(”",”",”");keyit.focus();
而如果写在页面中,新窗口可以获得焦点。IE没有问题,不知道此题何解?
void 0;keyit=window.open("","","");keyit.focus();
[Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]