As a javascript developer using onload often you will find that other script authors too love to use onload.作为一个JavaScript的开发人员使用的onload往往你会发现其他脚本作者太爱使用的onload 。 Unfortunately onload accepts a function name and your reassigning will prevent others from using onload.可惜的onload接受一个函数的名称和您的重新分配将防止其他人使用的onload 。 Here is a script which allows you to use onload even when others have used it and without breaking their script.这里是一个脚本,这可以让你用的onload ,甚至当别人都用它,并没有打破他们的脚本。

The key idea is that you should be able to stack your function(s) above / below existing function call.关键的想法是,你应该可以堆叠您的函数( )以上/下面现有的函数调用。 Let’s look at the sample code below:让我们看看示例代码如下:

I think I have well commented the code to make the script self-explanatory, but feel to ask questions.我想我已经好评论的代码,使脚本自我解释性,但觉得发问。 The code has been tested on Firefox, Internet Explorer and Opera.代码已经过测试,在Firefox , Internet Explorer和歌剧。