Ajax update and running scripts


I am using rjs to update a page and send a preview code for a widget.
However that code isn’t executed by the browsers.

The returned script looks like:

After a refresh this code is executed corectly, but when I send it
from RJS it isn’t run. I don’t see any requests back to rails.

Mostly likely I am missing something, but can’t figure out what.