On Mon, Jan 23, 2012 at 6:49 PM, Pedro Nascimento <pnasc...@gmail.com> wrote:
> Hi, I'm trying to append a widget to a div, but can't seem to do so.
>
> My widget is like this:
> http://pastie.org/3238256
>
> Notice that on add_widget(evt) I want to append what the widget renders, but
> can't seem to do so.
> If I replace line 13 with something simpler like render :text =>
> "alert('test');" it works, though. I've tried unescape_javascript, but looks
> like this is unavailable at this scope.
>
Well you need to escape the JS in the append string. Try #escape_js.
Also, you don't need the :after_initialize hook. Try this:
http://nicksda.apotomo.de/2011/10/released-apotomo-1-2/ Using the
:passing option you should be fine!!!