function searchMenu() {
var ChangPHP;
top_search.txt.onKeyDown = function() {
if (Selection.getFocus() == String(this) && Key.getCode() == 13) {
ChangPHP = escape(top_search.txt.text);
//把文本框内的文字换成UTF-8码.
trace(ChangPHP);
getURL(SINURL+"/index.php?gOo=goods_search_list.dwt&gcat=0&gkey="+ChangPHP+"&image.x=26&image.y=15", "");
trace("输入搜索文本1 : "+top_search.txt.text);
}
// end if
};
Key.addListener(top_search.txt);
for (var _loc2 = 0; _loc2<=link_Array[2].length; ++_loc2) {
var _loc3 = top_search["search"+_loc2];
_loc3.num = _loc2;
_loc3.onRelease = function() {
if (this.num == 0) {
flash.external.ExternalInterface.call("ShowSearch");
} else {
//tt=this._parent.txt.text;
//aa=escape(tt);
//trace(aa);
getURL("/display.im?cmd=totalSearch&searchKeyword2="+this._parent.txt.text, "");
trace("输入搜索文本2 :"+this._parent.txt.text);
}
// end else if
};
}
// end of for
}
// End of the function
上面的代码是实现把输出文本的内容转化为
UTF-8码 实现搜索地址 黄色部分字体是我添加的 想实现 把
top_search.txt.text 的内容转换为UTF-8码. 但输出的UTF-8码并不真确.
top_search.txt 是文本的路径.
本地调试
aa="专";//%E4%B8%93
bb=escape(aa);
trace(bb);// 当输出显示为 (正确) %E4%B8%93
为什么在上面
trace(ChangPHP); 中输出是%D7%A8
各位大侠 希望帮小弟解决下....联系QQ:190993377 邮件 colin-ling@163.com 谢谢!