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

后端 未结 14 1285
天涯浪人
天涯浪人 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:58

    just cut the string using split (the easy way):

    var myString = "http://localhost/dms/mduserSecurity/UIL/index.php?menu=true&submenu=true&pcode=1235"
    var mySplitResult = myString.split("?");
    alert(mySplitResult[0]);
    

提交回复
热议问题