How can I build JavaScript instruction dynamically from parameters? -



How can I build JavaScript instruction dynamically from parameters? -

i want build javascript instruction dynamically

the original instruction :

var chou = eval('(' + returnresult + ')').attribute;

i want pass attribute variable possible?

i have tried :

var chou = eval('(' + returnresult + ')').eval(baseentity);

but doesn't work.

i'll optimistic , assume returnresult json.

then can

var chou = json.parse(returnresult)[baseentity];

if it's not json trust source plenty utilize eval, do

var chou = eval('(' + returnresult + ')')[baseentity];

javascript

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -