On 1/25/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> Hello everyone :).
> I have a problem with toHTML function in MochiKit.js. I use the last
> version of this library MochiKit 1.3.1.
> The problem appear in this peace of code:
>
> window.onload = function()
> {
>  InitializeAPI() ;
>
>  if ( FCKBrowserInfo.IsIE )
>  FCK_PreloadImages() ;
>     else
>  LoadToolbarSetup() ;
>
> var e = window.parent.document.getElementById("taxonomyURL");
>  document.body.innerHTML+=toHTML(e);// --> the problematic line
> }
>
> I'm using FireBug to debugg this issue. I got such errors:
>
>
> dom has no properties
> emitHTML(null, [])MochiKit.js (line 3128)
> toHTML(null)MochiKit.js (line 3114)
> onload()
>
> and
>
> if(dom.nodeType==1){
> I don't understnad why argument(dome element, which is DIV element) of
> function toHTMl is null. I tried to alert the dom element (DIV) and for
> sure is not empty.
>
> In IE the error looks like:
>
> "Object required." and the problematic function is going to the to
> line:
>
>  document.body.innerHTML+=toHTML(e);// --> the problematic line
>
>
> How can I avoid this?? For any help i will be thankful. It's important
> for me.

It's impossible to say what happened without a *full* example.
However, your code is wrong anyway. toHTML is not for that purpose,
you want to use e.innerHTML.

The documentation for toHTML says the following:

Convert a DOM tree to a HTML string using emitHTML. This should be
used for debugging/testing purposes only.

The DOM property innerHTML or cloneNode(true) method should be used
for most purposes.

-bob

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to