Thanks for the feedback, you guys!

I did some more research, and found that Ajax.Updater actually is better, it
does everything that I've done manually until now. And in addition, it has
an "evalScripts" option, which claims pass all <script> blocks to the eval()
function. But my included script file is still not available, so I guess
this means that only inline scripts are evaluated, not included script
files.

The scripts I need are quite short, so I tried to solve this by using
renderSupport.addScript rather than including entire script files. But that
doesn't work either, since they are wrapped in Tapestry.onDOMLoaded(), which
doesn't exist on my non-tapestry page and isn't evaluated in the AJAX-loaded
T5 page...

My third option was to just use MarkupWriter to write my own script tag with
my inline script in there. That didn't work either, I got an error about
duplicate root tag <html> on my page.

I'm stumped, so I guess I'll try an entirely different approach :)

Thanks for your help anyway!

Inge

On Fri, Oct 9, 2009 at 7:53 PM, Christian Riedel
<[email protected]>wrote:

> i dont know if i get your problem right, but if the tapestry.js is
> available, you can use some of its magic:
>
> the value of the key "script" will be evaluated by the tapestry.js!
>
> JSonObject j = new JSonObject();
> j.put("script", "alert('hi!');");
> return j;
>
>
> regards
> christian
>
>
> cordenier christophe schrieb:
>
>  Hi
>>
>> If you only append content i don't think it will work. Have a look at how
>> Tapestry achieve JS loading in loadScriptsInReply method of 'tapestry.js'
>> file.
>>
>> christophe.
>>
>> 2009/10/9 Inge Solvoll <[email protected]>
>>
>>
>>
>>> Hi!
>>>
>>> I use prototype Ajax.Request to load a tapestry page url into a
>>> non-tapestry
>>> page. The response content is appended to the document with javascript.
>>>
>>> My problem is that javascript that is included in the tapestry page seems
>>> to
>>> not be included/interpreted in the browser when the content is received
>>> via
>>> XmlHttpRequest. It all works if I do a normal page render.
>>>
>>> Is this supposed to work, or do I have to find some other approach?
>>>
>>>
>>>
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to