@@Therry
<element onload="myScript">
Aber das war dann doch nur eine Idee die nicht zum Erfolg führte.
- 
Wofür steht
element? Dasload-Event feuert nicht bei beliebigen HTML-Elementen, sondern nur bei einigen. - 
Das
load-Event (beimwindow) feuert viel später als du sicher möchtest: nach dem Laden aller Ressourcen – incl. Bilder etc.Du willst sicher
DOMContentLoaded(was sich aber nicht im HTML miton…unterbringen lässt, was man aber sowieso nicht tun sollte). - 
Wenn du dein Script am Ende des
bodyeinbindest, brauchst du gar kein Event, sondern kannst dort deine Funktion aufrufen. 
😷 LLAP
-- 
“When I was 5 years old, my mother always told me that happiness was the key to life. When I went to school, they asked me what I wanted to be when I grew up. I wrote down ‘happy.’ They told me I didn’t understand the assignment, and I told them they didn’t understand life.” —John Lennon
  “When I was 5 years old, my mother always told me that happiness was the key to life. When I went to school, they asked me what I wanted to be when I grew up. I wrote down ‘happy.’ They told me I didn’t understand the assignment, and I told them they didn’t understand life.” —John Lennon