JS传值乱码问题
传值前正常,传值后取值时超过4个字的后1~2个出现乱码
附JS:
function newin(url,winame,w,h)
{
var xposition,yposition,theproperty;
xposition=0; yposition=0;
if ((parseInt(navigator.appVersion) >= 4 ))
{
xposition = (screen.width - w) / 2;
yposition = (screen.height - h) / 2-100;
}
theproperty= "width=" + w + ","
+ "height=" + h + ","
+ "location=0,"
+ "menubar=0,"
+ "resizable=0,"
+ "scrollbars=0,"
+ "status=0,"
+ "titlebar=0,"
+ "toolbar=0,"
+ "hotkeys=0,"
+ "screenx=" + xposition + "," //仅适用于Netscape
+ "screeny=" + yposition + "," //仅适用于Netscape
+ "left=" + xposition + "," //IE
+ "top=" + yposition; //IE
window.open( url,winame,theproperty );
}
------解决方案--------------------你是指winame值乱码还是url值乱码??
------解决方案--------------------
用escape()函数将字符串加密试试看
------解决方案--------------------通过url传值在js中应使用escape()进行编码...
------解决方案--------------------估计你的url后面的参数有非数字和英文的字符吧,要用escape()编码的
------解决方案--------------------参数应该使用urlencode编码
------解决方案--------------------escape处理一下