Martin Bialasinski a écrit :
> On 11/14/06, Andrei Popov <[EMAIL PROTECTED]> wrote:
>
>> When I am tracing execution of [1] in Drosera (or Venkman, for that
>> matter), I see that for some reason $('myform') returns undefined
>> (this is n prototype.js 1.5.0_rc0). However, CSS does not seem to
>> have any problem styling it.
>
> Looks like you have the script before the 'myform' element in your
> document. Also Ken is right about .bindAsEventListener().
Your diagnosis is most likely correct. There's no way for $() to return
undefined if the element with this exact ID appeared in the DOM before.
This is most likely a case of the observation happening too early.
So Andrei: either put it in a script tag later in the doc (bleah!), or
create a page-init function that contains this code and make this
function observe window's load event.
As for bAEL: this is only true if the function is a method and needs
proper "this" access. In the sample case Andrei provided, this has no
incidence whatsoever.
Oh, and Andrei: your HTML example has no means of regular submission for
the form: neither submit- nor image-typed input's. So submission relies
on some JS mechanism? FWIW, remember that's inaccessible (I know, you
use JS to short-circuit it anyway, but hey...).
--
Christophe Porteneuve a.k.a. TDD
"[They] did not know it was impossible, so they did it." --Mark Twain
Email: [EMAIL PROTECTED]
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---