全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

CeraNetworks网络延迟测速工具IP归属甄别会员请立即修改密码
查看: 2473|回复: 7

请教怎么访问a.html#xx_xx跳转到a.html

[复制链接]
发表于 2018-7-25 16:58:29 | 显示全部楼层 |阅读模式
遇到这个问题:www.1.net/a.html#payments_alipay 跳转关系与规则不符

想不到好的解决方法,怎么实现取消.html后面的变量
访问1.net/a.html#xx_xx然后定向到1.net/a.html
 楼主| 发表于 2018-7-25 17:09:19 | 显示全部楼层
怎么解决呢?
发表于 2018-7-25 17:11:36 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
发表于 2018-7-25 17:12:28 | 显示全部楼层
window.location.href.split('#')[window.location.href.split('#').length-1] 大概这样?
 楼主| 发表于 2018-7-25 17:18:09 | 显示全部楼层
mxy123h 发表于 2018-7-25 17:12
window.location.href.split('#')[window.location.href.split('#').length-1] 大概这样?

大佬有完整版吗,
发表于 2018-7-27 14:10:51 | 显示全部楼层
板凳 发表于 2018-7-25 17:18
大佬有完整版吗,

<script language="javascript">
if(window.location.href.split('#').length>1){
window.location.href=window.location.href.split('#')[0]
}
</script>
发表于 2018-8-11 01:22:43 | 显示全部楼层
服务器的重定向不行吗? 要在静态页面做?
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2024-3-29 21:05 , Processed in 0.059725 second(s), 9 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表