Code
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<script type="text/javascript" language="JavaScript" src="lib/PCASClass.js"></script>
</head>
<body>
<input type=button onclick=encodes() value=压缩> <input type=button onclick=decodes() value=解压>
<textarea id="ttt" rows=35 cols=120></textarea>
<script>
<!--
PCAD=PCAD.replace("--请选择省份--$--请选择城市--,--请选择地区--#","")
document.getElementById("ttt").value=PCAD
function decodes(){
PCAD=document.getElementById("ttt").value;
for(i=0;i<PCAStore.length;i=i+2)PCAD=PCAD.replace(RegExp(PCAStore.substr(i,1),"g"),PCAStore.substr(i+1,1));
for(i=0;i<PCAStead.length;i=i+2)PCAD=PCAD.replace(RegExp(PCAStead[i],"g"),PCAStead[i+1]);
document.getElementById("ttt").value=PCAD;
}
function encodes(){
PCAD=document.getElementById("ttt").value;
for(i=0;i<PCAStead.length;i=i+2)PCAD=PCAD.replace(RegExp(PCAStead[i+1].replace(/([|$])/,"\\$1"),"g"),PCAStead[i].replace("\\",""));
for(i=0;i<PCAStore.length;i=i+2)PCAD=PCAD.replace(RegExp(PCAStore.substr(i+1,1),"g"),PCAStore.substr(i,1));
document.getElementById("ttt").value=PCAD;
}
//-->
</script>
</body>
</html>
posted @
2009-08-25 12:58
Adam.Zhao
阅读(
1674)
评论()
编辑
收藏
举报