addLoadEvent函数
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了addLoadEvent函数相关的知识,希望对你有一定的参考价值。
Description: Execute different functions when the page loads in a better way than default onload JS event. Include it in the end of the JS document.Arguments: Name of the function that you want to execute when the page loads.
Author: Simon Willison
function addLoadEvent(func) { var oldonload = window.onload; if (typeof window.onload != 'function') { window.onload = func; } else { window.onload = function() { oldonload(); func(); } } }
以上是关于addLoadEvent函数的主要内容,如果未能解决你的问题,请参考以下文章