jquery - Passing Objects as Parameters in javascript function -


i want pass objects parameters javascript function ,

i had tried following,actually iam calling function function in innerhtml..

var tempobj={         result:results,         jsobj:jsobj     }      str +='<input type="button" onclick="buildcstrwisechart('+tempobj+')" value="view" class="btn btn-info">'; 

but didnt works me iam getting error like..

syntaxerror: missing ] after element list [break on error]     buildcstrwisechart([object object]) 

can 1 in this..

you treating object if string. that's error.

is tempobj global variable? if so,

str +='<input type="button" onclick="buildcstrwisechart(tempobj)" value="view" class="btn btn-info">';` 

Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -