Somewhat on-topic: we should really figure this out, enumerate go/no-go use-cases, and write something up, since it comes up pretty frequently--I was never able to reproduce that JIRA issue around this, but I'd sure like to put this issue to rest w/ an easily-spewable wiki page.
Dave --- On Sat, 8/16/08, Jeromy Evans wrote: > From: Jeromy Evans <[EMAIL PROTECTED]> > Subject: Re: javascript in returned jsp through xhr > To: "Struts Users Mailing List" <user@struts.apache.org> > Date: Saturday, August 16, 2008, 10:35 PM > Kropp, Henning wrote: > > Hi, > > > > I am a little stuck here. A action loads a jsp into a > div. For this I > > use the ajax theme (dojo) and a form submit with > target. Works fine. > > The Problem ist, that the jsp returned by the action > has javascript in > > it. Its the jcalendar. Having this jsp load normally > the calendar > > works fine, but not in div. > > > > To solve this I tried executeScripts option, but that > did not work. I > > searched and found out that eval might help, but I > simply dont know > > how this could help. > > > > Any hints would be greatly appreciated. Many thanks > in advanced! > > Ensure separateScripts is also true. > > Cut back the javascript to the bare minmial first (eg. an > alert). A lot > of javascript has problems in this scenario because it > assumes the DOM > is complete or won't change before it's executed. > I think dojo updates > the DOM, the executes discovered scripts, but in some > browsers you can > get race conditions. eg. calls getElementById before that > element > exists properly (eg. exists and all its content exists). > > The best approach is to use a listener that initialises the > javascript > calendar only after it's certain the DOM is up-to-date, > rather than > using inline javascript in the result.. > > Hope that helps. > > Jeromy Evans > > > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]