Javascript window.onload
I have updated the Protected copyright photo using
Simon Willison's addLoadEvent() function.
The problem for me is to be able to write a tutorial that can be understood easily by a beginner, copied and used without too much re-writing. I have a Javascript file that I import which controls the email address display and the events. To avoid conflicts, I had removed the imported file from the Protected photos page (I could have written another Javascript file with all the window.onload calls, imported it and solved all the problems, but it would have been even more difficult to explain, making the tutorial understandable only by advanced Javascript programmers). Now I wrote it back in and added some comments in the Javascript code to explain what is going on. For a beginner is confusing: how to import files, what happens, why, in which order..Simon Willison solution is pretty straightforward and should be easily understood, especially since there is a clear explanation of how it works.