Having link_to_function with insert_html locks up browser when doing replace_html


I have a link_to_function in a div, and when I try to call
replace_html on the div, the link_to_function locks up my browser when
it tries to replace my div. Any idea why and how to solve it? It’s
consistently reproducible.