現在、window.location.hrefを個別に検索しています。
window.location.href:http://www.example.com/6CATA/folder/file.html
var searchWinHref = window.location.href;
if(searchWinHref.indexOf("/6CATA/") > -1) {
alert('6CATA is in the window.location.href');
}
アラートをトリガーします。
配列内の文字列の1つと一致するように変数searchWinHrefをクエリするために、これをどのように適応させることができますか?
var searchWinHref = window.location.href;
var searchWinArray = ['6CATA', '6CATB', '6CATC'];
if(searchWinHref.indexOf(searchWinArray)) {
alert('alert which code is in the window.location.href');
}