我是Jquery的新手,并且一直在寻找解决此问题的方法-
我在Jquery文件顶部使用以下内容来限制仅在主页上工作
if (top.location.pathname === '/')
{
如何更改此设置使其也可以在/ About页面上使用?
提前致谢!
最佳答案
您只需要这样做
if (top.location.pathname === '/' || top.location.pathname ==='/About' )
{
// Your code goes here
}