Javascript Troubles

I’m have some troubles with some javascript that is being generated. I
have the following in my view.

<%=link_to_remote(image_tag(‘delete.gif’),
:update => {
:success => update_element_function(
“name_#{@child.id}”,
:action => :remove)
},
:url => {
:action => “delete_category”,
:id => @child.id
})%>

So we have a link_to_remote() function that calls a action and then
remove a bit of HTML on success. Seems fairly harmless. But the
following is generated:

Delete

As you can see the success code has single quotes in it but the success
code is in a single quote itself. This causes a syntax error. Any
suggestions?

Eric