I am using Firefox and I want to call a function (Logger) 10 seconds after the page has loaded. I am using this code
if (document.addEventListener)
document.addEventListener("DOMContentLoaded", Logger, false)
Any advice?
I am using Firefox and I want to call a function (Logger) 10 seconds after the page has loaded. I am using this code
if (document.addEventListener)
document.addEventListener("DOMContentLoaded", Logger, false)
Any advice?
Share Improve this question asked Nov 7, 2010 at 8:17 RefRef 331 silver badge3 bronze badges1 Answer
Reset to default 4You can do like this:
window.onload = function(){
setTimeout("func_name", 10000);
};
Where func_name
is normal function:
function func_name(){
// code here...
}
Or you can even do this:
window.onload = function(){
setTimeout(function(){
// your code...
}, 10000);
};
More Info:
- http://www.w3schools./jsref/met_win_settimeout.asp
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745477039a4629391.html
评论列表(0条)