jquery - display data using Ajax -


i want display data in value field of dictionary using ajax. know format display, stuck in displaying 1 of fields. code here :

$.each(result, function(index, element) {       alert(element.place);       alert(element.unique name);    }); 

element.unique name doesn't work there space in between( unique name not uniquename). guys me out displaying this?

fiddle answer

    var data = {     "employees": [{         "firstname": "john",         "unique name": "doe"     }, {         "firstname": "anna",         "unique name": "smith"     }, {         "firstname": "peter",         "unique name": "jones"     }] };  $.each(data, function (index, element) {     alert(index);     $.each(element, function (inde, data1) {         alert(inde);         alert(data1.firstname);         alert(data1['unique name']);     }); }); 

i think may meet requirements. plz let me know if works.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -