Dinesh, Sorry for the late arrival on this thread, but man, JQuery, YUI, and Prototype in the same project? IMO, that is a massivly bad idea. I mean, even from a client download perspective, that means downloading 3 large JS libs... let alone the massive amount of conflict with operators!
As David rightly says, there are normal JS widgets out there for all 3 frameworks that will do what you want to do - In lifts case, we use JQuery, so generally speaking, that is the path of least resistance. YUI is another option, but of course, the additional lift-widgets package is based on JQuery, so you loose out there if thats what you'd like to use... Whilst I cant speak for anyone else, given your situation, Id opt for the path of least resistance and make your lift a lot more straight forward. Happy holidays people Tim On Dec 24, 2:18 pm, "David Pollak" <[email protected]> wrote: > 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 < > > > > [email protected]> 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... > > , > > >http://www.456bereastreet.com/archive/200501/the_perils_of_using_xhtm... > > ). > > 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 frameworkhttp://liftweb.net > Collaborative Task Managementhttp://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 [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~----------~----~----~----~------~----~------~--~---
