代码如下:
<script>
function productClass(){
var prod_name = null;
var prod_id = null;
var is_group = null;
var is_base = null;
var priceList = null;
var spList = null;
} var prod2 = new productClass();
prod2.prod_name = "111";
alert(prod2.prod_name);
alert(("prod"+2).prod_name);
</script>为什么 alert(("prod"+2).prod_name); 不可以,我是根据数字来找对象的,请问该怎么写啊?alert($('prod'+i));也不可以的
<script>
function productClass(){
var prod_name = null;
var prod_id = null;
var is_group = null;
var is_base = null;
var priceList = null;
var spList = null;
} var prod2 = new productClass();
prod2.prod_name = "111";
alert(prod2.prod_name);
alert(("prod"+2).prod_name);
</script>为什么 alert(("prod"+2).prod_name); 不可以,我是根据数字来找对象的,请问该怎么写啊?alert($('prod'+i));也不可以的
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货