如果我用這個,如果條件URL參數和具體條件
(window.location.href.split("/")[6] !== "Product-A" || window.location.href.split("/")[6] !== "Product-B" || window.location.href.split("/")[6] !== "Product-C" || window.location.href.split("/")[6] !== "Intro" || window.location.href.split("/")[6] !== "vol-A-Free" || window.location.href.split("/")[6] !== "vol-B")
和我走的結果true
但是,如果我只用這
我有這個網址http://www.example.com/ln-en/Category/Product/Product-A/Details
window.location.href.split("/")[6] !== "Product-A"
我拿回false
與我期待給第一個條件。什麼可能是錯的?
我想要做的大條件是,如果window.location.href.split( 「/」)[6]如果不等於所有的值我去if語句 – therin
@therin - 是的,看到答案中的最後一句話。 – Quentin