誰かが助けてくれることを願っています-私はこれでどこにも行きません。いくつかの Umbraco ノードで構成されるシリアル化された JSON 文字列を作成しました。JQuery を使用して特定のプロパティの値を取得しようとしています。
添付の画像は、Chrome 開発ツールを使用して検査した配列の構造です。
ご覧のとおり、オブジェクト内に 3 つの配列があり、各配列内に 3 つのプロパティを持つ 12 個のオブジェクトがあります。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"}]]
誰かが助けてくれることを願っています。
ありがとう