js urlencode

时间:2023-12-13 19:09:26
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="Generator" content="EditPlus®">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
<title>Document</title>
</head>
<body>
<script type="text/javascript">
var test1="分享";
var test2="%E5%88%86%E4%BA%AB";
document.write("编码<br/>"+test1+":"+encodeURIComponent(test1)+ "<br />");
document.write("解码<br/>"+test2+":"+decodeURIComponent(test2));
</script>
</body>
</html>