Replace JavaScript function on favorite feature.