jquery - Cannot retrieve data from javascript json object created in javascript -


i have servlet returns string [["one","two"],["one","two"]], array representation.

this sent front end using gson library's tojson() method string. sends string array along other attributes in json format , i'm using tojson() method send front end.

in ajax response handling, i'm doing $.parsejson() on object , retrieving values. (it works fine , able retrieve array string.)

now in javascript need create json object other values along string array , send javascript method. in method cannot retrieve values. motive extract array string array , iterate it.

following in javascript send javascript method:

var streamid = stream + constants.colon + streamversion; var eventsdata = {}; var jsondata = [];  eventsdata ["source"] = streamid; eventsdata ["data"] = eventsarray; jsondata.push(eventsdata); onsuccessfunction(jsondata); 

in onsuccessfunction tried jsondata.data, says undefined.

any suggestions?


Comments

Popular posts from this blog

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -