Originally Posted by felgall
onload is also unnecessary except if your script needs to confirm if all the images have loaded. For simple interactions with the page simply attaching the script at the bottom of the page results in a lot less code and the script running a lot sooner.
Also alert() is for debugging purposes only and should never be used in a published script.
well i was not to say that it was the only way... it could be simply done at the bottom of the script as:
and your done..
as for the global variables, i understand, but they still do exist.. so i added them into the example.. and for an alert(), i understand this as well, but this example is not based on what the program does, its about a technique for writing it. so maybe this were for debugging purposes? its just to show whats supposed to go through the app.
i do appreciate the input however!