Is there any method to get the URL without query string?

后端 未结 14 1307
天涯浪人
天涯浪人 2020-11-28 19:22

I have a URL like http://localhost/dms/mduserSecurity/UIL/index.php?menu=true&submenu=true&pcode=1235.

I want to get the URL without the query s

14条回答
  •  难免孤独
    2020-11-28 19:49

    Read about Window.location and the Location interface:

    var url = [location.protocol, '//', location.host, location.pathname].join('');
    

提交回复
热议问题