我目前使用下面的代碼來定位具體網頁,如http://my-website.com/about/的jQuery如果Location.Pathname包含
if (document.location.pathname == "/about/") {
//Code goes here
}
我想知道如何爲有一定的父頁等所有頁面做同樣的如/about/
在以下實施例..
http://my-website.com/about/child-page1
http://my-website.com/about/child-page2