将URL中的?=字符串更改为主题标签

Jay*_*Dee -3 jquery

我正在寻找一个匹配的代码片段?=在URL中并用#替换它.

例如:

http://www.example.com?=100

会成为:

HTTP://www.example.com#100

编辑: - 感谢您的帮助,希望用#替换?=并使用: -

  var getURL = window.location.href
  var changeURL = getURL.replace("?=", "#");
  window.location.replace(changeURL);
Run Code Online (Sandbox Code Playgroud)

The*_*net 10

为什么需要使用jQuery?

"http://www.example.com?=100".replace("?=", "#")
//result: http://www.example.com#100
Run Code Online (Sandbox Code Playgroud)