更新时间:2022-03-13 07:13:00
尝试:
if (window.location.href.indexOf("catalogue") > -1) { // etc
indexOf不返回true/false,它返回搜索字符串在字符串中的位置;或-1(如果找不到).
indexOf doesn't return true/false, it returns the location of the search string in the string; or -1 if not found.