javascript - How to call json from string -


i have ajax function need call json named string, how deal that?

$.ajax({   url: fulluri + curid,   type: "get",   datatype: 'json',   success: function (data) {      $.each(data.data, function (key, value) {         var typeinput = data.fields[key];         if (typeinput == 'select'){            var listjson = 'data.'+uri+'-'+key;            $.each(listjson,function(key2,value2){               alert(value2);            }          } 

and json :

data:     data:         articles_title: "title",        articles_content: "content"        users_id: 1     fields:        articles_content: "textarea"        articles_title: "text"        users_id: "select"     article-users_id:        field: "value"        field2: "value2" 

my question how call data.article-users_id because created dynamicly... thank you

you can't navigate object properties way:

obj["property1.property2.property3"]

...but need way:

obj["property1"]["property2"]["property3"]


Comments

Popular posts from this blog

routing - AngularJS State management ->load multiple states in one page -

python - GRASS parser() error -

Swift game error message -