小编SBM*_*SBM的帖子

如果Location.Pathname包含jQuery

我目前正在使用以下代码来定位各个页面,例如http://my-website.com/about/

    if (document.location.pathname == "/about/") {
        //Code goes here
    }
Run Code Online (Sandbox Code Playgroud)

我想知道如何对具有某个父页面的所有页面执行相同的操作,例如/about/以下示例.

http://my-website.com/about/child-page1

http://my-website.com/about/child-page2

url jquery pathname

4
推荐指数
2
解决办法
2万
查看次数

标签 统计

jquery ×1

pathname ×1

url ×1