client side js for favorites