beforeload with UL

22 views
Skip to first unread message

Alon Raskin

unread,
Dec 23, 2010, 12:14:10 PM12/23/10
to iphone...@googlegroups.com

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.

 

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.

 

 

Alon Raskin

e: ara...@go3i.com

 

RobG

unread,
Dec 23, 2010, 10:23:30 PM12/23/10
to iPhoneWebDev


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:

<URL: http://www.w3.org/TR/html401/interact/scripts.html#adef-onload
>


> 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?


--
Rob

Chrilith

unread,
Dec 24, 2010, 2:41:18 AM12/24/10
to iPhoneWebDev

> 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.

This seem to be the expected behavior with this iUI event.
You should indeed use "load" or execute your load script at the end of
your page in order to do something with your <ul> before navigating to
it.

Remi Grumeau 

unread,
Dec 24, 2010, 4:40:13 AM12/24/10
to iphone...@googlegroups.com
beforeload is an attribute i have done for Alon. It's a custom & spécific code.

It's ok we are working on it.

R.

> --
> You received this message because you are subscribed to the Google Groups "iPhoneWebDev" group.
> To post to this group, send email to iphone...@googlegroups.com.
> To unsubscribe from this group, send email to iphonewebdev...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/iphonewebdev?hl=en.
>

Alon Raskin

unread,
Dec 24, 2010, 7:06:37 AM12/24/10
to iphone...@googlegroups.com
Thanks for clearing that up Remi. Appologies to the group. I was not aware that it was custom.

Regards,

Alon Raskin
e: ara...@go3i.com
Reply all
Reply to author
Forward
0 new messages