wrapping DOM objects

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

wrapping DOM objects

Dave Mason-3
I have defined a class to provide methods for a couple of DOM classes (I asked a related question back in the 0.12 days and eventually figured it out with help from the list and now I'm moving to 0.14).

I looked at the page https://github.com/amber-smalltalk/amber/wiki/Wrapping-javascript-constructors-recipe but it's unclear how to use it.  This is what I tried (based on what worked in 0.12):

amber.api.wrapClassName("NodeList","xxx",NodeList,amber.globals.NativeCollection) 
amber.api.wrapClassName("HTMLCollection","xxx",HTMLCollection,amber.globals.NativeCollection) 

I put these in the index.html file (because I can't grok where else to put them), but they don't have the desired effect.  The NativeCollection class is a subclass of SequenceableCollection which defines do:, but I get:

JavaScript exception: TypeError: undefined is not a function (evaluating '$recv($recv(document)._getElementsByClassName_("program"))._do_')

and if I check, it's the _do_ that is undefined.

So obviously I'm doing this wrong.  Any suggestion?

Thanks!

../Dave

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.