Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9066869
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T16:48:52+00:00 2026-06-16T16:48:52+00:00

For a college assignment I have to read JSON data into an Adobe Edge

  • 0

For a college assignment I have to read JSON data into an Adobe Edge project. In the JSON below you will see I made an array of colors. A function setElementsColor(color) has to look up the correct object in the Colors array of the json file. So the argument color has to be equal the colorName of the object. I am not quite sure how to do this.

Here is the JSON:

{
    "Colors": [
        {
            "colorName": "Black",
            "imageName": "fridge_black.jpg",
            "footerName": "black_footer.png",
            "facebookLogo": "black_facebook.png",
            "twitterLogo": "black_twitter.png",
            "linkedinLogo": "black_linkedin.png"
        },
        {
            "colorName": "Blue",
            "imageName": "fridge_blue.jpg",
            "footerName": "blue_footer.png",
            "facebookLogo": "blue_facebook.png",
            "twitterLogo": "blue_twitter.png",
            "linkedinLogo": "blue_linkedin.png"
        }
    ]
}

The following function is used to read out the JSON-file.

function setElementsColor(color){
  $.getJSON('json/colors.json',function(data){
    //The JSON must be read out here
  });
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T16:48:53+00:00Added an answer on June 16, 2026 at 4:48 pm

    I’d use $.grep.

    function setElementsColor(color){
      $.getJSON('json/colors.json',function(data){
        var obj = $.grep(data.Colors, function(color) {
          return color.colorName === color;
        });
        /* Use obj */
      });
    }
    

    I’d be easier if Colors were an Object instead of an Array.

    Disclaimer: Untested.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an assignment in college in which we are required to read in
I have made a College Management System project in Java using Netbeans 6.9.1 and
For an assignment in college, we have to make a script in Perl that
I have a college project where I need to extend an existing spreadsheet application
For a college assignment I have to develop a product site for Smegg fridges
My college course just started going over mongodb and we have an assignment to
I am working on an assignment for a college course involving json and node.js.
I have an assignment to be done in college, a piece asks for the
For a college assignment we have to add a system call to the Linux
For college, we have been given an assignment where, given an image, we have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.