84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
比如:
var abc='def'; var def=999; alert(abc);
我如何通过变量abc获取到变量def的值999因为def是从数据库获取的,变化的,我不知道它是def,也有可能是xyz也就是:
var abc='xyz'; var xyz=777; alert(abc);
不知道我的描述,诸位能清楚吗
认证高级PHP讲师
var abc='xyz'; var xyz=777; alert(window[abc]);
//写闭包中就这样 (function(){ abc='xyz'; xyz=777; alert(window[abc]); })();
之前已有类似问题,请参考这个答案
之前已有类似问题,请参考这个答案