Cal*_*lum 5 html javascript
有没有办法检测你在JavaScript中的页面?
我想知道的原因是我可以检测到我所在的页面,然后相应地设置元素的样式.
m.e*_*son 6
document.URL 将为您提供当前页面的 URL。
document.URL
要检查特定页面,您将使用:
if ( document.URL.includes("homepage.aspx") ) { //Code here }
归档时间:
12 年,7 月 前
查看次数:
11375 次
最近记录:
7 年,7 月 前