admin管理员组文章数量:1406140
when I click on submit button url is:
http://localhost/college/index.php?field=1&exam=ATMA&submit3=%23success
I want to replace this link with:
http://localhost/college/index.php?field=1&exam=ATMA&submit3=#success
How can I do this ?
when I click on submit button url is:
http://localhost/college/index.php?field=1&exam=ATMA&submit3=%23success
I want to replace this link with:
http://localhost/college/index.php?field=1&exam=ATMA&submit3=#success
How can I do this ?
Share Improve this question asked Jan 17, 2017 at 10:06 sam ortensam orten 2064 silver badges18 bronze badges 1-
2
When you submit, is your backend expecting the value for
submit3
to be#success
? If so, don't change it, handle it in the backend. A#
has special meaning. it would be like trying to getsubmit3=&success
to have submit3 =&success
- you'd need to encode the&
in the same way that#
is encoded here. – fdomn-m Commented Jan 17, 2017 at 10:10
2 Answers
Reset to default 3The functions you are looking for are
PHP:
urlencode($string);
urldecode($string);
Javascript:
decodeURIComponent(string);
encodeURIComponent(string);
Try the following decodeURIComponent
:
decodeURIComponent('http://localhost/college/index.php?field=1&exam=ATMA&submit3=%23success')
本文标签: javascripthow can I replace 23 within urlStack Overflow
版权声明:本文标题:javascript - how can I replace %23 with # in url? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744975419a2635487.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论