You need to duplicate some of the work in Request.HTML. Strip the scripts
from your html partials, inject your html, and then evaluate it. Look at
Request.HTML to see how it does it. Further, Request.HTML makes the logic
that does this a method, meaning you can pass in your own method if you
prefer. This allows you to essentially alter how Request.HTML works on a
per-instance level.

On Tue, Oct 6, 2009 at 8:16 AM, jtreitz <[email protected]> wrote:

>
> Hey guys,
>
> still having this exact problem for months, maybe i dont see the wood
> for the trees :-)
>
> Let's say I fire an ajax request and the then called server-side logic
> decides its time to update 3 regions on the page. Only way I see to do
> this is sending back some javascript like this:
>
> reg1.set('html', LOAD HTML-PARTIAL AS STRING HERE);
> reg2.set('html', LOAD HTML-PARTIAL AS STRING HERE);
> reg3.set('html', LOAD HTML-PARTIAL AS STRING HERE);
>
> The client-side Request evals the response as expected and replaces
> the 3 regions with the new html code BUT if a html partial itself
> contains some scripts they wont be evaluated resulting in replaced
> regions not working anymore.
>
> What would you do? Thanks!
>
> Johannes
>

Reply via email to