扫码关注官方订阅号
jQuery如何判断当前页面是否在首页?
如果要用javascript写又该怎么写呢?
ringa_lee
根据window.location.pathname获得当前页面path name
判断path name和你所谓的首页对应的path name(比如是/index.html)是否一致
这么简单的东西,JS就搞定了
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
扫描下载App
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
根据window.location.pathname获得当前页面path name
判断path name和你所谓的首页对应的path name(比如是/index.html)是否一致
这么简单的东西,JS就搞定了