Re: Marhsalling DOMNode's between languages

"Michel Carroll" <[email protected]> Wed, 19 Jul 2006 22:43:29 -0000
Newsgroups gmane.comp.web.dom.wdf
Message-ID <[email protected]>
Hi John,

this sounds like a reasonably sound idea, similar to what is done in
ajax.net, where an attempt is made to converge languages for the sake
of rationalising the developer's task. However, you must realise that
any "encapsulation" of javascript will not replace the necessity of a
good knowledge of javascript and the DOM.

One point, get your casing and method names right. getElementById,
setAttribute, etc.

Otherwise, I'm all for it.

Michel

--- In [email protected], "john_f_mclaughlin"
<john_f_mclaughlin@...> wrote:
>
> Hi All,
> 
> I hope this isn't too basic of a question... I've done a bunch of
> research and I can't seem to get quite clear the best way of doing
> something.
> 
> I've got a little app that is partly written in Javascript and partly
> written in Objective-c.  What I'd like to do is to be able to pass
> DOMnodes between the two languages and I'm not sure what the best way
> to do this is.
> 
> In fact, I've only puzzled out one method so far.  Use the ID of the
node.
> 
> My basic idea is when I want to move the Node between the languages I
> first check to see if it has an ID assigned.  If it does then I pass
> back the ID. If it doesn't I create and assign a ID for the object and
> then pass back that newly created ID (as a string)
> 
> On both sides I can use getElementByID to get the actual object back
> in their respective languages.
> 
> While I haven't coded this up yet I think it should work but I'm
> worried I'm missing something obvious.  Is there a better way of doing
> this?
> 
> As a final question:  I assume I can attach an ID to a node creating
> an element of type 'id' and assigning my (temporary) id to it and then
> attaching it to the DOM node with SetAttributeNode (correct?)
> 
> Thanks
> -John
>






------------------------ Yahoo! Groups Sponsor --------------------~--> 
See what's inside the new Yahoo! Groups email.
http://us.click.yahoo.com/2pRQfA/bOaOAA/yQLSAA/9rHolB/TM
--------------------------------------------------------------------~-> 

Unsubscribe
[email protected]

List info
http://www.quirksmode.org/dom/list.html 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/wdf-dom/

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/