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和歌劇。