参考1:http://www.w3school.com.cn/js/jsref_encodeURIComponent.asp

参考2:http://www.w3school.com.cn/js/jsref_decodeURIComponent.asp

 

实例:

<script type="text/javascript">

var test1="http://www.w3school.com.cn/My first/"

document.write(encodeURIComponent(test1)+ "<br />")
document.write(decodeURIComponent(test1))

</script>

输出:

http%3A%2F%2Fwww.w3school.com.cn%2FMy%20first%2F
http://www.w3school.com.cn/My first/

  

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-23
  • 2021-07-09
  • 2022-12-23
  • 2022-02-12
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-11-03
  • 2022-01-25
  • 2021-06-13
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案