我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

替换window.location.hash中的字符url [关闭]

so, I have an anchor that is getting called by replacing the space with a - using the php str_replace, now inside of the javascript hash I want to undo these changes so users will search for the words without these -. any response would be appreciated.

var href = "a-b-c";
    href = href.replace(/\-/g,"");

    console.log(href);

Will work and replace all "-" instead one.

You can try here https://codepad.remoteinterview.io/MAZLREUGKE

近期文章

  • WooCommerce已完成订单的附加电子邮件
  • 如何在PHP中修剪字符DEL(ASCII代码127)
  • yii2唯一验证器仅当字段不为空时
  • 无法获得简单的doophp演示工作,链接坏了
  • Prestashop 1.6 - 从TPL按钮调用函数
  • 检测到laravel中fieldname的无效UTF-8
  • 仅使用FTP访问安装wordpress
  • PHP - 为HTML5 <AUDIO>创建'DYNAMIC'目录
  • Yii,在不使用隐藏字段的情况下设置模型值
  • 你能发现foreach()错误的来源吗?
  • PHP OOP返回并调用单个数组值
  • Symfony2表单:在每个元素附近添加删除图标
  • 存储的MySQL过程与动态MySQL查询
  • 使用Kerberos进行PHP Active Directory身份验证
  • 500内部服务器错误 - dojo.js或我的PHP文件?
  • 我如何在magento中找到dispatchEvent方法?
  • PHP - 如果不存在,则添加指向字符串中URL的链接
  • PHP在一个输入中分隔两个不同的部分
  • 将.htaccess文件和localhost变为空
  • 如何让用户能够在表单中上传图片?

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华