利用js实现不同域名显示不同备案的方法天亦网2年前发布关注私信0180 现实项目当中我们经常会遇到到多个域名访问一个页面或者一个站点的时候,限制备案的审核比较严格,就需要域名对应页面要放正确的备案号下面我们可以利用js实现。 <footer> <a href="https://beian.miit.gov.cn" id="miit" style="color: #000000" target="_blank">湘ICP备19003460号-1</a> <a href="https://www.beian.gov.cn/portal/registersystemInfo?recordcode=44011102002930" id="beian" style="color: #000000" target="_blank" >粤公网安备44011102002930号</a> <p> <script> const domain = location.host; const config = { 'czmz.top': { miit: '湘ICP备19003460号-1', beian: '粤公网安备44011102002930号', code: '44011102002930', }, 'czidc.vip': { miit: '湘ICP备19003460号-2', beian: '粤公网安备44011102003081号', code: '44011102003081', }, '0735.pro': { miit: '湘ICP备19003460号-3', beian: '粤公网安备44011102003089号', code: '44011102003089', }, 'centos.club': { miit: '湘ICP备19003460号-4', beian: '粤公网安备44011102003201号', code: '44011102003201', }, }; for (const key in config) { const pattern = new RegExp(key); if (pattern.test(domain)) { const item = config[key]; document.getElementById('miit').innerHTML = item.miit; document.getElementById('beian').innerHTML = item.beian; document.getElementById('beian').href = 'https://www.beian.gov.cn/portal/registersystemInfo?recordcode=' + item.code; } } </script> </p> </footer> 温馨提示:本文最后更新于2023-07-30 17:38:33,某些文章具有时效性,若有错误或已失效,请私信客服或联系知新社长。 © 版权声明文章版权归作者所有,未经允许请勿转载。 七月 30 知岛上的今时往日 2024:诺瑞亚:黄金计划/Noreya: The Gold Project (0)2024:宠物店模拟器/Pet Shop Simulator (0)2024:冠军变身/Champion Shift (0)2024:与龙共存/Living With Dragons (0)2024:永恒瀑布/Everafter Falls (0) THE END软件/使用/设置 喜欢就支持一下吧点赞0赞赏 分享QQ空间微博QQ好友海报分享复制链接收藏