javascript解决中文传递乱码和特殊字符问题

ContractedBlock.gif ExpandedBlockStart.gif Code
//一种是替换掉特殊字符
//加密解密
function btnPrint_onclick() 
{
   var dnd 
= $get('<%=ddlstBynj.ClientID%>');
   var dndIndex
=dnd.selectedIndex;
   
if(dndIndex==0)
   {
     var nd
="";
   }
   
else
   {
      var nd
=dnd.options[dndIndex].text;
   }
   var str 
= $get('<%=hfdQeuryCondition.ClientID%>').value;
   var strWhere
=str.replace(/(%)/g,"|^!|");
   openwindow(
"StuGraduationStatRPT.aspx?strWhere="+encodeURIComponent(strWhere)+"&nd="+encodeURIComponent

(nd),
null,800,600);
}
script

转载于:https://www.cnblogs.com/hubcarl/archive/2009/05/10/1453496.html

你可能感兴趣的:(javascript解决中文传递乱码和特殊字符问题)