Hi there,
On Dec 14, 2007 5:26 PM, Glin <[EMAIL PROTECTED]> wrote:
> I tried to use selector example from Mochikit documentation:
>
> var selector = MochiKit.Selector.Selector('#someelementid');
>
> But I got this error:
>
> this.parseExpression is not a function
>
> It is on line 37 in Selector.js.
>
> Should I initialize something before I use this module? Or is it a
> bug?
Yeah, the docs were wrong as Bob said, he has fixed that swiftly :)
If you are doing one-off selections of elements, it is easier to use
the functions $$ or findChildElements.
The Selector() object only deals with simple selectors (i.e. not
containing combiners, such as space, >, + and ~). One optimization I
would like to see, but don't have time for myself, is caching of those
object, possibly optional. This would mean you could use $$ or
findChildElements with the same expressions multiple times within a
page without suffering the penalty of parsing and compiling it every
time.
So, there's an idea for patch if you or anyone is interested :)
cheers,
Arnar
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"MochiKit" 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/mochikit?hl=en
-~----------~----~----~----~------~----~------~--~---