Get the page file name from the address bar

后端 未结 7 1152
隐瞒了意图╮
隐瞒了意图╮ 2020-12-09 15:32

I was wondering if it would be possible to get the page name from the address bar using jquery or javascript. I know this can be done using PHP but don\'t really want to as

相关标签:
7条回答
  • 2020-12-09 16:08

    The Location object is your friend:

    var pageName = location.pathname.substring(1);
    

    http://www.w3schools.com/jsref/obj_location.asp

    0 讨论(0)
提交回复
热议问题