Re: Parsing programmatically constructed inline constructors
Alex Russell <[email protected]>
| Newsgroups | gmane.comp.windows.devel.netwindows |
|---|---|
| Organization | netWindows.org |
| Message-ID | <[email protected]> |
On Tuesday 09 September 2003 00:45, Christian Boulanger wrote:
> If I want JavaScript to write innerHTML of nw inline-constructors and
> NetWindows to parse the result afterwards, how do I do that?
>
> (You might think that this is crazy, but it is actually sometimes easier
> than using the programmatic constructors)
Yes, actually, it is crazy = )
That aside, you'd have to pass a node reference, and in order to do that, you
must have your HTML string converted into DOM nodes somehow. Here's how I'd
do it:
var container = document.createElement("span");
span.innerHTML = "<span nwType='foo'>...</span>";
widgetObj = NW_INLINE_CTOR_FUNC(span.firstChild);
document.body.appendChild(widgetObj.domNode);
Let me know if that's not clear enough.
Please note that this method is neither blessed nor recommended. Programatic
constructors are provided for a reason.
Regards.
--
Alex Russell
[email protected] BD10 7AFC 87F6 63F9 1691 83FA 9884 3A15 AFC9 61B7
[email protected] F687 1964 1EF6 453E 9BD0 5148 A15D 1D43 AB92 9A46
_______________________________________________
The netWindows developers list: [email protected]
http://netwindows.org/mailman/listinfo/devel_netwindows.org