let temp = '' function getUrl() { let firstUrl = window.location.href; let secondUrl = firstUrl.substring(firstUrl.length - 4, firstUrl.length) let json = [{ key: 'bkjx', value: '1056' }, { key: 'yjspy', value: '1047' }, { key: 'xsgz', value: '1038' }, { key: 'djgz', value: '1041' }, { key: 'tmxy', value: '1079' }, { key: 'scientific', value: '1006' }, { key: 'zsjy', value: '1040' }, { key: 'pxzx', value: '1069' }, ] json.forEach(function(e) { if (firstUrl.indexOf(e.key) >= 0) { secondUrl = e.value $('.' + e.key).css('display', 'block') } }) } function getUrlNotice() { let firstUrl = window.location.href; let secondUrl = window.location.href.split("/")[3].split(".")[0] if (secondUrl == "tzgg") { $('.tzgg').css('display', 'block') } }