function definition inside script in remote call

I'm using remote request to update a div with a table. At the end of
the table I have some javascript where I define a function