On Dec 24, 3:14 am, Alon Raskin <aras...@go3i.com> wrote:
> Hi Everyone,
> Not sure if the problem is in front of the keyboard or behind it but I would appreciate your insight.
> I have a UL element in my app which has a beforeload attribute set. This calls my JS function to be called. Problem is that this event is only raised if I navigate to my UL. If I simply load the page with the UL inside the Body tags the JS doesn't get called. Does anyone if this is a bug? And if so, has a fix been created for this.
It is not a bug as there is no "beforeload" attribute specified in
HTML 4.01. Perhaps you are using a library that uses custom (non-
standard) attribute? Isn't any script that executes before the load
event "before load"?
You could use the load event, but that happens after load and the UL
element isn't specified as supporting it:
> I guess the easy answer is to simply attach my JS to the onload of the BODY but before I did that I wanted to see if there is a solution already out there.
The body element is the appropriate place for attaching onload
listeners. Alternatively, you can place a script element immediately
after the UL closing tag - that doestn't guarantee all the content of
the UL has loaded, but should generally be OK.
But don't you want *before* load?