sName=encodeURIComponent(sName);
var url="reg_te2.shtml?type="+mUserType+"&id="+vID+"&name="+sName;
<script type="text/javascript">

document.write(escape("http://www.w3school.com.cn") + "<br />")

document.write(escape("?!=()#%&"))

</script>
http%3A//www.w3school.com.cn

%3F%21%3D%28%29%23%25%26
<script type="text/javascript">

document.write(encodeURI("http://www.w3school.com.cn")+ "<br />")

document.write(encodeURI("http://www.w3school.com.cn/My first/"))

document.write(encodeURI(",/?:@&=+$#"))

</script>
http://www.w3school.com.cn

http://www.w3school.com.cn/My%20first/

,/?:@&=+$#
<script type="text/javascript">

document.write(encodeURIComponent("http://www.w3school.com.cn"))

document.write("<br />")

document.write(encodeURIComponent("http://www.w3school.com.cn/p 1/"))

document.write("<br />")

document.write(encodeURIComponent(",/?:@&=+$#"))

</script>
http%3A%2F%2Fwww.w3school.com.cn
http%3A%2F%2Fwww.w3school.com.cn%2Fp%201%2F
%2C%2F%3F%3A%40%26%3D%2B%24%23

<script language="javascript">
document.write('<a href="http://passport.baidu.com/?logout&aid=7&u='+encodeURIComponent("http://cang.baidu.com/bruce42")+'">退出</a>');
</script>