私は配列を持っています:
var checkURL = ['abc123', 'abc124', 'abc125'];
配列内の文字列の1つがwindow.location.pathnameに存在するかどうかを確認するにはどうすればよいですか?
私は個人的に使用できることを知っています:
<script type="text/javascript">
$(document).ready(function () {
if(window.location.href.indexOf("abc123") > -1) {
alert("your url contains the string abc123");
}
});
</script>