嗨,我目前正在处理一个 html 表单,将表单数据从一个 html 表单传递到另一个表单。显示数据时,我%20在每个空间的位置。有没有办法替换这个?
我在接收页面中的代码是:
<script type = "text/javascript">
document.write("Business Name: ", BusinessName);<-- Variables that are passed through URL-->
document.write("Business Type: ", BusinessType);
document.write("Business Purpose: ", BusinessPurpose);
</script>
Run Code Online (Sandbox Code Playgroud)
您的字符串是 url 编码的。就unescape这样。
unescape("asd%20asd")
-> "asd asd"
Run Code Online (Sandbox Code Playgroud)