Dinesh,

.innerHTML works just fine in Lift apps.  I use it all over the place.  In
fact, every Comet update is done with an .innerHTML.

To make sure it works, I put this line in a template:

        <span id="replace_me"></span>
        <script>
          // <![CDATA[
          document.getElementById('replace_me').innerHTML = '<b>.innerHTML
works just fine, thank you.</b>';
          // ]]>
        </script>

In the past, I've tried to integrate Prototype into a jQuery-based app.
It's a very, very tough thing to do.  It took me a day to get the import
order absolutely right.  I would strongly recommend against it.  At this
point, jQuery plugins have the same range of functionality as do
Prototype-based plugins.  It may also be that Prototype is conflicting with
YUI.  You may want to look into using the jQuery Treeview:
http://jquery.bassistance.de/treeview/demo/

To figure out why the error is happening (it's not happening because
.innerHTML doesn't work... it does it fact work just fine), I'd suggest
using Firebug to set a breakpoint just before the offending line in YUI.
Inspect the value what is about to be put in the innerHTML.  Is it valid
XML?  Is it valid XHTML?  It may very well be that YUI is generating invalid
XHTML.

If you go with the approach of setting the mime type of the page to
text/html, you'll ruin most of the layout and cause a fair number of other
issues because quirks mode does not deal well with certain tags being well
formed XML (e.g., the <script/> tag has to be <script></script>).

So, to summerize:

   - .innerHTML works just fine in strict XML mode
   - The problem with YUI tree is coming from something else and Firebug can
   help you debug it
   - Mixing Prototype and jQuery is a challenge and I'd strongly recommend
   against it
   - Moving to quirks mode by setting the mime type text/html with destroy
   the layout of the existing style and cause a lot of problems in Buy a
   Feature

Thanks,

David


On Tue, Dec 23, 2008 at 10:26 PM, dineshvasudevan <
dinesh.vasude...@gmail.com> wrote:

>
> Hi,
>
> I am pretty new to lift and am working with Dan getting some things
> done. The system is currently setup to insert the lift comet
> javascript (which is in jQuery) inside the layout file. I needed to
> use the prototype library along with this and so added the
> 'jQuery.noConflict()' code call so that the conflict is resolved. I am
> also using the Yahoo library to display a tree. The Doctype was Xhtml
> Strict as set by scala. It immediately gave me errors like 'uncaught
> exception: [Exception... "Component returned failure code: 0x80004003
> (NS_ERROR_INVALID_POINTER) [nsIDOMNSHTMLElement.innerHTML]" nsresult:
> "0x80004003 (NS_ERROR_INVALID_POINTER)" '. It was not allowing the
> script to execute statements like 'element.innerHTML ="dasd"'.
>
> This I read is an issue with the content-type of the rendered page
> which is 'application/xhtml+xml'.(references -
> http://www.quirksmode.org/bugreports/archives/2004/11/innerhtml_in_xh.html
> ,
>
> http://www.456bereastreet.com/archive/200501/the_perils_of_using_xhtml_properly/
> ).
> I also saw some work arounds (https://developer.mozilla.org/En/
> Writing_JavaScript_for_XHTML) but they do not work as the changes
> would affect the library rendering.
>
> How could I solve this problem?
>
> Thanks and Regards,
> Dinesh
>
> >
>


-- 
Lift, the simply functional web framework http://liftweb.net
Collaborative Task Management http://much4.us
Follow me: http://twitter.com/dpp
Git some: http://github.com/dpp

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to