页面部分代码如下
//初始化产品文本框
var prods = new Array();
<s:iterator value="#request.BUSIPROD" id="item" status="st">
prods[${st.count-1}] = toAllPinyin('<s:property value="#item.prod_name" />') + "|" + '<s:property value="#item.prod_id" />' ;
</s:iterator> function productClass(){
var prod_name = null;
var prod_id = null;
var is_group = null;
var is_base = null;
var priceList = null;
var spList = null;
}
productClass.prototype.init = function(name,id){
this.prod_name = name;
this.prod_id = id;
this.is_group = "1";
this.serv_id="";
this.base_serv_id="";
this.priceList = new Array();
this.spList = new Object();
}
productClass.prototype.getPrices = function(prodid){
}
var prodinfomap = new Object();
<s:iterator value="#request.BUSIPROD" id="item1" status="st"> var prods${st.count-1} =new productClass();
prods${st.count-1}.prod_name='<s:property value="#item1.prod_name" />';
prods${st.count-1}.prod_id='<s:property value="#item1.prod_id" />';
prods${st.count-1}.is_group='<s:property value="#item1.is_group" />';
prods${st.count-1}.serv_id='<s:property value="#item1.serv_id" />';
prods${st.count-1}.base_serv_id='<s:property value="#item1.base_servs" />';
prods${st.count-1}.is_base='<s:property value="#item1.is_base" />';
prods${st.count-1}.priceList = new Object();
<s:if test="#item1.is_group!=1" >
<s:iterator value="#item1.tariffList" id="tariff" status="tarst">
var tariff${st.count-1}${tarst.count-1}=new Object();
tariff${st.count-1}${tarst.count-1}.code='<s:property value="#tariff.tariff_id" />';
tariff${st.count-1}${tarst.count-1}.name='<s:property value="#tariff.tariff_desc" />';
tariff${st.count-1}${tarst.count-1}.billingtype='<s:property value="#tariff.billing_type" />';
tariff${st.count-1}${tarst.count-1}.rentyearfee='<s:property value="#tariff.rent_year_fee" />';
tariff${st.count-1}${tarst.count-1}.rentmonthfee='<s:property value="#tariff.rent_month_fee" />';
prods${st.count-1}.priceList['t_<s:property value="#tariff.tariff_id" />']=tariff${st.count-1}${tarst.count-1};
</s:iterator>
</s:if>
prodinfomap['<s:property value="#item1.prod_id" />']=prods${st.count-1};
</s:iterator>
var feenames = new Array();
//根据产品名称得到产品资费
// 得到资费信息
function getFeename(){
alert("111");
var fname = "";
if($('prod_name')){
fname = $('prod_name').value;
alert(fname);
alert(prods.length);
for(var i = 0; i<prods.length;i++ )
alert(prods[i].prod_name)
if(fname == prods[i].prod_name){
if(prods[i].tariffList.length>0){
var option=document.createElement("OPTION");
$('feename').add(option);
dwr.util.addOptions('district',prods[i].tariffList,'code','name','');
}
}
}
}
请问我怎么得不到这个alert(prods.length);
的值啊,那里错了 啊,希望指正下。
//初始化产品文本框
var prods = new Array();
<s:iterator value="#request.BUSIPROD" id="item" status="st">
prods[${st.count-1}] = toAllPinyin('<s:property value="#item.prod_name" />') + "|" + '<s:property value="#item.prod_id" />' ;
</s:iterator> function productClass(){
var prod_name = null;
var prod_id = null;
var is_group = null;
var is_base = null;
var priceList = null;
var spList = null;
}
productClass.prototype.init = function(name,id){
this.prod_name = name;
this.prod_id = id;
this.is_group = "1";
this.serv_id="";
this.base_serv_id="";
this.priceList = new Array();
this.spList = new Object();
}
productClass.prototype.getPrices = function(prodid){
}
var prodinfomap = new Object();
<s:iterator value="#request.BUSIPROD" id="item1" status="st"> var prods${st.count-1} =new productClass();
prods${st.count-1}.prod_name='<s:property value="#item1.prod_name" />';
prods${st.count-1}.prod_id='<s:property value="#item1.prod_id" />';
prods${st.count-1}.is_group='<s:property value="#item1.is_group" />';
prods${st.count-1}.serv_id='<s:property value="#item1.serv_id" />';
prods${st.count-1}.base_serv_id='<s:property value="#item1.base_servs" />';
prods${st.count-1}.is_base='<s:property value="#item1.is_base" />';
prods${st.count-1}.priceList = new Object();
<s:if test="#item1.is_group!=1" >
<s:iterator value="#item1.tariffList" id="tariff" status="tarst">
var tariff${st.count-1}${tarst.count-1}=new Object();
tariff${st.count-1}${tarst.count-1}.code='<s:property value="#tariff.tariff_id" />';
tariff${st.count-1}${tarst.count-1}.name='<s:property value="#tariff.tariff_desc" />';
tariff${st.count-1}${tarst.count-1}.billingtype='<s:property value="#tariff.billing_type" />';
tariff${st.count-1}${tarst.count-1}.rentyearfee='<s:property value="#tariff.rent_year_fee" />';
tariff${st.count-1}${tarst.count-1}.rentmonthfee='<s:property value="#tariff.rent_month_fee" />';
prods${st.count-1}.priceList['t_<s:property value="#tariff.tariff_id" />']=tariff${st.count-1}${tarst.count-1};
</s:iterator>
</s:if>
prodinfomap['<s:property value="#item1.prod_id" />']=prods${st.count-1};
</s:iterator>
var feenames = new Array();
//根据产品名称得到产品资费
// 得到资费信息
function getFeename(){
alert("111");
var fname = "";
if($('prod_name')){
fname = $('prod_name').value;
alert(fname);
alert(prods.length);
for(var i = 0; i<prods.length;i++ )
alert(prods[i].prod_name)
if(fname == prods[i].prod_name){
if(prods[i].tariffList.length>0){
var option=document.createElement("OPTION");
$('feename').add(option);
dwr.util.addOptions('district',prods[i].tariffList,'code','name','');
}
}
}
}
请问我怎么得不到这个alert(prods.length);
的值啊,那里错了 啊,希望指正下。
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货