我有从服务返回的这个 Json 数据。
这是我完整的 json 数据
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函数
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);
});
}
});
但它对我不起作用是否有任何其他方法可以通过 jquery 读取这些数据。
谢谢你的帮助。