jquery - AJAX - Parsing JSON -


i attempting match id of table cell id specified within json file. if match found later description. everytime ran, skips straight error message. doing wrong?

function getjson(showid){     $.ajax({         type: 'get',         url:'json/tvshows.json',         datatype: 'jsonp',         success: function(data){             $.each(data, function(key,tvshow){                 tvshow.description;                 var tvshowid = tvshow.id;                  if (tvshowid == showid) {                     var description = tvshow.description;                     console.log(description);                 }             })         },         error:function(){             console.log('error occured in getdescription');         }        }); //ends ajax request  } 

you should using:

datatype: 'json', 

Comments

Popular posts from this blog

matlab - "Contour not rendered for non-finite ZData" -

javascript - Any ideas when Firefox is likely to implement lengthAdjust and textLength? -

delphi - Indy UDP Read Contents of Adata -