Ajax rjs - escape single quote in returned string?

I replace an outer html as following :

page.insert_html(:after, ‘hidden_values’, “”)

but if params[:new_title] string has a single quote like “can’t get
all the string”
the html is shorten…
what’s the trick to escape the returned string ?

tfyl

kad