How To Add Functions To Javascript onload Over Third Party Scripts; Playing Nice Come aggiungere funzioni javascript onload a più di script da parte di terzi; Riproduzione di Nizza
As a javascript developer using onload often you will find that other script authors too love to use onload. Come sviluppatore con javascript onload spesso troverete che altri script di autori troppo amore per usare onload. Unfortunately onload accepts a function name and your reassigning will prevent others from using onload. Purtroppo onload accetta un nome di funzione e il tuo riassegnazione impedirà ad altri di usare onload. Here is a script which allows you to use onload even when others have used it and without breaking their script. Ecco uno script che consente di utilizzare onload anche quando gli altri lo hanno utilizzato e senza rompere i loro script.
The key idea is that you should be able to stack your function(s) above / below existing function call. L'idea chiave è che si dovrebbe essere in grado di impilare il tuo funzione (s) di cui sopra / sotto esistenti chiamata di funzione. Let’s look at the sample code below: Vediamo il codice di esempio qui di seguito:
I think I have well commented the code to make the script self-explanatory, but feel to ask questions. Credo di aver ben commentato il codice per rendere lo script spiega da sé, ma sento di fare domande. The code has been tested on Firefox, Internet Explorer and Opera. Il codice è stato testato su Firefox, Internet Explorer e Opera.
Filed under Elencato sotto Browser , Firefox , Headline News Headline News , How To Come , Internet Explorer Internet Explorer , Javascript , Programming Programmazione , Web , Web 2.0 2,0 web , Web Services Servizi Web | |
| |
RSS 2.0 RSS 2,0 | |
Trackback this Article | questo articolo |
Email this Article Invia questo articolo
You may also like to read Si può anche leggere come |




February 7th, 2007 at 10:34 pm 7 febbraio 2007 a 10:34 pm
Where is the sample code? Dove si trova il codice di esempio?
February 8th, 2007 at 1:08 am 8 febbraio 2007 alle 1:08 am
hi there, Hi there,
I don’t see any code — I use firefox 1.5.x on windows. Non vedo alcun codice - Io uso Firefox 1.5.x le finestre.
Thank you, Grazie,
BR,
~A ~ Una
February 8th, 2007 at 3:09 am 8 febbraio 2007 alle 3:09 am
Thanks for the catch. Grazie per la cattura. I forgot to escape the <’s and >’s Ho dimenticato di sfuggire alla < 's e>' s
April 30th, 2007 at 5:44 pm 30 aprile 2007 alle 5:44 pm
Thanks for the script! Grazie per lo script!
October 26th, 2007 at 6:30 am 26 ottobre 2007 alle 6:30 am
Great idea. Grande idea. I created a function, addEventHandler, that simplifies adding this technique to new Javascripts. Ho creato una funzione, addEventHandler, che semplifica l'aggiunta di questa tecnica ai nuovi script Java.
Thanks for addressing this issue. Grazie per affrontare questo problema. It was a recent concern of mine. E 'stato un recente preoccupazione di miniera.