Does this mean I will need to repeat window.onload=function() every time for each object that has an alert?

what about using Core.start with init ? would that work? how?

thank youMartin

Martinscript
—
2010-10-28T19:19:46Z —
#5

thank you for the explanation PhilipToop, greatly appreciated:)

PhilipToop
—
2010-10-29T07:35:18Z —
#6

Does this mean I will need to repeat window.onload=function() every time for each object that has an alert?

javascript has the concept of events. each event can be associated with a javascript function. When the event occurs the function is executed. There are numerous events (using the mouse or keyboard, setting focus to an input element etc etc). The onload is one such event and is associated with the html document. It is execute only once when the document has loaded.

There are various ways of associating a function with an event. window.onload = function is just one. You can also do it on the body tag <body onload="dothisonload()"> (where dothisonload is a javascript function). You can also do it with an addEventListener or attachEvent method (which does depend on the browser as whether the method belongs to the window of document object). Good practice would be to use the last method.