modify js function in detail page and wishlist page, easier for unit test