希望有人可以提供帮助-我对此无能为力。我创建了一个由一些 Umbraco 节点组成的序列化 JSON 字符串,并且我正在尝试使用 JQuery 获取某些属性的值。
附图是数组的结构,使用 Chrome 开发工具检查:
如您所见,对象中有 3 个数组,每个数组中有 12 个具有 3 个属性的对象。数组是以这种方式构造的,因为我使用的是 getJSON() 方法。
尽我所能,我似乎无法访问其中的属性。
我已经从 JQuery 中剥离了所有内容,只留下了裸露的骨头:
<script type="text/javascript">
$(document).ready(function () {
$.getJSON('http://myURLCaseStudyImagesJSON', function (data) {
});
});
</script>
如果有人可以就如何做到这一点提出建议,我将不胜感激。我不想以大量嵌套的 for 循环结束,但即使尝试也不会给出结果。实际的原始 JSON 是这样的:
[[{"Alias":"googleAC","Value":"","Version":"00000000-0000-0000-0000-000000000000"},{"Alias":"metaKeywords","Value":"","Version":"00000000-0000-0000-0000-000000000000"},{"Alias":"metaDescription","Value":"","Version":"00000000-0000-0000-0000-000000000000"},{"Alias":"pageTitle","Value":"Royal","Version":"00000000-0000-0000-0000-000000000000"},{"Alias":"pageHeading","Value":"Royal Heading","Version":"00000000-0000-0000-0000-000000000000"},{"Alias":"pageSubHeading","Value":"Royal Sub Heading","Version":"00000000-0000-0000-0000-000000000000"},{"Alias":"pageContent","Value":"\u003cp\u003eRoyal\u003c/p\u003e","Version":"00000000-0000-0000-0000-000000000000"},{"Alias":"caption","Value":"Dave didn\u0027t wait to book. We didn\u0027t wait to blink.","Version":"00000000-0000-0000-0000-000000000000"},{"Alias":"caseStudyMainImage","Value":"1357","Version":"00000000-0000-0000-0000-000000000000"},{"Alias":"caseStudyImages","Value":"1357","Version":"00000000-0000-0000-0000-000000000000"},{"Alias":"displayHomePageCarousel","Value":"1","Version":"00000000-0000-0000-0000-000000000000"},{"Alias":"imageUrl","Value":"/media/8777/swimmer.jpg","Version":"00000000-0000-0000-0000-000000000000"},{"Alias":"caseStudyUrl","Value":"/our-work/advertising-and-promotions/royal/","Version":"00000000-0000-0000-0000-000000000000"}],[{"Alias":"googleAC","Value":"","Version":"00000000-0000-0000-0000-000000000000"},{"Alias":"metaKeywords","Value":"","Version":"00000000-0000-0000-0000-000000000000"},{"Alias":"metaDescription","Value":"","Version":"00000000-0000-0000-0000-000000000000"},{"Alias":"pageTitle","Value":"Walter Title","Version":"00000000-0000-0000-0000-000000000000"},{"Alias":"pageHeading","Value":"Walter Heading","Version":"00000000-0000-0000-0000-000000000000"},{"Alias":"pageSubHeading","Value":"Walter Sub Heading","Version":"00000000-0000-0000-0000-000000000000"},{"Alias":"pageContent","Value":"\u003cp\u003eWalter Content\u003c/p\u003e","Version":"00000000-0000-0000-0000-000000000000"},{"Alias":"caption","Value":"Mickey waved his magic wand and magic happened","Version":"00000000-0000-0000-0000-000000000000"},{"Alias":"caseStudyMainImage","Value":"1355","Version":"00000000-0000-0000-0000-000000000000"},{"Alias":"caseStudyImages","Value":"","Version":"00000000-0000-0000-0000-000000000000"},{"Alias":"displayHomePageCarousel","Value":"1","Version":"00000000-0000-0000-0000-000000000000"},{"Alias":"imageUrl","Value":"/media/8767/mickey.jpg","Version":"00000000-0000-0000-0000-000000000000"},{"Alias":"caseStudyUrl","Value":"/our-work/brandingcorporate-identity/walter/","Version":"00000000-0000-0000-0000-000000000000"}],[{"Alias":"googleAC","Value":"","Version":"00000000-0000-0000-0000-000000000000"},{"Alias":"metaKeywords","Value":"","Version":"00000000-0000-0000-0000-000000000000"},{"Alias":"metaDescription","Value":"","Version":"00000000-0000-0000-0000-000000000000"},{"Alias":"pageTitle","Value":"Sea Life","Version":"00000000-0000-0000-0000-000000000000"},{"Alias":"pageHeading","Value":"Sea Life Heading","Version":"00000000-0000-0000-0000-000000000000"},{"Alias":"pageSubHeading","Value":"Sea Life Sub Heading","Version":"00000000-0000-0000-0000-000000000000"},{"Alias":"pageContent","Value":"\u003cp\u003eSea Life Content\u003c/p\u003e","Version":"00000000-0000-0000-0000-000000000000"},{"Alias":"caption","Value":"Sea life it\u0027s an education","Version":"00000000-0000-0000-0000-000000000000"},{"Alias":"caseStudyMainImage","Value":"1356","Version":"00000000-0000-0000-0000-000000000000"},{"Alias":"caseStudyImages","Value":"1356","Version":"00000000-0000-0000-0000-000000000000"},{"Alias":"displayHomePageCarousel","Value":"1","Version":"00000000-0000-0000-0000-000000000000"},{"Alias":"imageUrl","Value":"/media/8772/shark.jpg","Version":"00000000-0000-0000-0000-000000000000"},{"Alias":"caseStudyUrl","Value":"/our-work/print-designproduction/sea-life/","Version":"00000000-0000-0000-0000-000000000000"}]]
希望有人可以提供帮助。
谢谢