JSON Fields are Undefined (Javascript) -


i'm getting json servlet , turning responsetext json object using json.parse(). chrome developer tools shows json object having data want, when try access bunch of 'undefined's.

am not interpreting data correctly?

screenshot of chrome developer tools: debug output of json object

and briefly, code output data:

        (var = 0, len = jsonobj.length; < len; ++i) {             // setup result...             var resultrow = document.createelement("tr");             resultstable.appendchild(resultrow);                         var result = jsonobj[i];              // name             var covercell = resultrow.insertcell(0);             covercell.innerhtml = result.name;         } 

jsondata seen in screenshot passed output function jsonobj.

the key trying access seems have @ character @ front. since @ character not valid identifier , therefore can't use dot-notation, can retrieve value using bracket notation:

covercell.innerhtml = result['@name']; 

Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -