1. source:{a:'a',b:'b',c:'c',d:'d',e:'e'}
原JS是如上所写
2.想把大括号里面的值用一个变量代替,改怎么写呢?下面的写法不对
var t="a:'a',b:'b',c:'c',d:'d',e:'e'";
source:{t}
t = { a: 'a', b: 'b', c: 'c', d: 'd', e: 'e' };
JSON吧
var t="{a:'a',b:'b',c:'c',d:'d',e:'e'}";
source= eval('('+t+')')
eval