I have this Json data returning from a service.
here is my complete json data
d: "[{"ImagePath":null,"ThemeTemplateId":1,"BorderWidth":null,"BorderStyle":null,"OptionTextUnderline":null,"OptionTextItalic":null,"OptionTextBold":null,"OptionTextSize":null,"OptionTextFont":null,"QuestionTextUnderline":null,"QuestionTextItalic":null,"QuestionTextBold":null,"QuestionTextSize":null,"QuestionTextFont":null,"SurveyTitleUnderline":null,"SurveyTitleItalic":null,"SurveyTitleBold":null,"SurveyTitleSize":null,"SurveyTitleFont":null,"BorderColor":null,"SurveyTitleColor":null,"OptionTextColor":null,"ThemeName":null,"BackgroundColor":null,"QuestionTextColor":null},{"ImagePath":null,"ThemeTemplateId":2,"BorderWidth":null,"BorderStyle":null,"OptionTextUnderline":null,"OptionTextItalic":null,"OptionTextBold":null,"OptionTextSize":null,"OptionTextFont":null,"QuestionTextUnderline":null,"QuestionTextItalic":null,"QuestionTextBold":null,"QuestionTextSize":null,"QuestionTextFont":null,"SurveyTitleUnderline":null,"SurveyTitleItalic":null,"SurveyTitleBold":null,"SurveyTitleSize":null,"SurveyTitleFont":null,"BorderColor":null,"SurveyTitleColor":null,"OptionTextColor":null,"ThemeName":null,"BackgroundColor":null,"QuestionTextColor":null}]"
///ajax function
jQuery.ajax({
type: "POST",
url: "3.aspx/GetThemeList",
data: "{'clientid':'" + -1 + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (returndata) {
console.log(returndata);
jQuery.each(returndata, function (index, theme) {
alert(theme.ImagePath);
alert(theme.ThemeTemplateId);
});
}
});
but its not working for me is there any other method to read this data through jquery.
Thanks for your help.
dinreturndata? You don't show that in your example JSON. And have you specified a JSON data type or usedgetJSONsince it doesn't look like you're parsing the string into JSON yourself?jsondatatype.