1. Use attachEvent to add the functions that need to be run to onload
if (document.all)
{
window.attachEvent('onload', FuncName)
}
else
{
window.addEventListener('load ', FuncName, false);
}
2. Use window.onload = function(){FuncName1(); FuncName();} to directly onload the two functions. You can add a judgment,
var o = window.onload;
if ((typeof o)=='function')
window.onload = function(){o(); FuncName();}
else
window.onload = FuncName;
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn