js代码里参数为汉字就提示undefined帮忙看一下

qq_41032699 2018-05-03 01:31:26
现在给的参数是汉字就会提示undefined有两段代码我不知道是哪有问题所有都贴上了,完全小白,求大神帮忙
var place = {
async: {
enable: true,
url:"DataAction.aspx?act=place",
autoParam:[],
otherParam:[],
dataFilter: null
},
data: {
key: {
title:"t"
},
simpleData: {
enable: true
}
},
callback: {
onClick: SearchByGPlace
}
};
function SearchByGPlace(event, treeId, treeNode, clickFlag) {
$("#store").text(treeNode.t);
$("#selnum").text("1");
var res = Com.BC863.Web.ClassifySearch.SearchByPlace(1, treeNode.t, false, "", "");
if(res.error) return showAjaxProError(res.error);
//$(".SeaCon").css("padding-top","20px");
$(".SeaCon").html("");
$(".SeaCon").html(res.value);
$(".xnl").height($(".sml_left").height());
var check=document.getElementById("tj1");
check.checked = false;
}
function QieHuanPage2(page, placeid, isrig, key, word){
$("#selnum").text("1");
var res = Com.BC863.Web.ClassifySearch.SearchByPlace(page, placeid, isrig, key, word);
if(res.error) return showAjaxProError(res.error);
//$(".SeaCon").css("padding-top","20px");
$(".SeaCon").html("");
$(".SeaCon").html(res.value);
$(".xnl").height($(".sml_left").height());
}
还有段代码
function LeiBieChange()
{
var num = $("#explei").val();//下拉框选中的是哪个
var check=document.getElementById("tj1");//复选框
check.checked = false;
$("#stype").val("bkname");//搜索类型
$("#w").val("");//搜索框
$('.xnr_tree ul.nod').children().eq(num).addClass('active').siblings().removeClass('active');
}
//复选框选中事件
function CkZhong()
{
var check=document.getElementById("tj1");
var cnclass = $("#cnclass").text();//中国分类号
var store = $("#store").text();//馆藏地
var dcgl = $("#dcgl").text();
if(check.checked==true)
{
var num = $("#selnum").text();
if(num == 0)//中国分类号查询
{
if(cnclass == "")
{
check.checked = false;
return;
}
var res = Com.BC863.Web.ClassifySearch.SearchByZhongTu(1, cnclass, true, "", "");
if(res.error) return showAjaxProError(res.error);
//$(".SeaCon").css("padding-top","20px");
$(".SeaCon").html("");
$(".SeaCon").html(res.value);
$(".xnl").height($(".sml_left").height());
$("#w").val("");//搜索框
$("#stype").val("bkname");//搜索类型
}
else if(num == 1)//馆藏地查询
{
if(store == "")
{
check.checked = false;
return;
}
var res = Com.BC863.Web.ClassifySearch.SearchByPlace(1, store, true, "", "");
if(res.error) return showAjaxProError(res.error);
//$(".SeaCon").css("padding-top","20px");
$(".SeaCon").html("");
$(".SeaCon").html(res.value);
$(".xnl").height($(".sml_left").height());
}
else if(num == 2)//馆藏分类查询
{
if(dcgl == "")
{
check.checked = false;
return;
}
var res = Com.BC863.Web.ClassifySearch.SearchByClass(1, dcgl, true, "", "");
if(res.error) return showAjaxProError(res.error);
//$(".SeaCon").css("padding-top","20px");
$(".SeaCon").html("");
$(".SeaCon").html(res.value);
$(".xnl").height($(".sml_left").height());
}
else if(num == 3)//默认
{
var res = Com.BC863.Web.ClassifySearch.BookBand(1, true, "", "");
if(res.error) return showAjaxProError(res.error);
//$(".SeaCon").css("padding-top","20px");
$(".SeaCon").html("");
$(".SeaCon").html(res.value);
$(".xnl").height($(".sml_left").height());
}
}
else
{
var num = $("#selnum").text();
if(num == 0)
{
if(cnclass == "")
{
return;
}
var res = Com.BC863.Web.ClassifySearch.SearchByZhongTu(1, cnclass, false, "", "");
if(res.error) return showAjaxProError(res.error);
//$(".SeaCon").css("padding-top","20px");
$(".SeaCon").html("");
$(".SeaCon").html(res.value);
$(".xnl").height($(".sml_left").height());
$("#w").val("");//搜索框
$("#stype").val("bkname");//搜索类型
}
else if(num == 1)
{
if(store == "")
{
check.checked = false;
return;
}
var res = Com.BC863.Web.ClassifySearch.SearchByPlace(1, store, false, "", "");
if(res.error) return showAjaxProError(res.error);
//$(".SeaCon").css("padding-top","20px");
$(".SeaCon").html("");
$(".SeaCon").html(res.value);
$(".xnl").height($(".sml_left").height());
}
else if(num == 2)
{
if(dcgl == "")
{
check.checked = false;
return;
}
var res = Com.BC863.Web.ClassifySearch.SearchByClass(1, dcgl, false, "", "");
if(res.error) return showAjaxProError(res.error);
//$(".SeaCon").css("padding-top","20px");
$(".SeaCon").html("");
$(".SeaCon").html(res.value);
$(".xnl").height($(".sml_left").height());
}
else if(num == 3)//默认
{
var res = Com.BC863.Web.ClassifySearch.BookBand(1, false, "", "");
if(res.error) return showAjaxProError(res.error);
//$(".SeaCon").css("padding-top","20px");
$(".SeaCon").html("");
$(".SeaCon").html(res.value);
$(".xnl").height($(".sml_left").height());
}
}
}
...全文
5054 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
s5042220 2018-05-30
  • 打赏
  • 举报
回复
参数带有字符串你不用引号括起来吗
qq_41032699 2018-05-03
  • 打赏
  • 举报
回复
我也不知道哪个参数,就是馆藏地查询的时候馆藏地是汉字就出错
yaotomo 2018-05-03
  • 打赏
  • 举报
回复
哪个参数???

87,955

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧