Martti Mäger Martti Mäger - 2 years ago 140
JSON Question

Get value of a complex key with jQuery

I ran into a problem using the Pipedrive API. I tried to get some data using the below but it returned an error:

$.each(, function(key,value) {

However this works:

$.each(, function(key,value) {

Why can't I get values of the keys that are complex strings generated by the Pipedrive system?

Answer Source

To retrieve what you require you would need to use bracket notation as the first character of the property identifier is an integer. Try this:

var value = {
    '0d1df598a5539ab5b6b410b339dc9218e0acb091': 'foo bar'


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download