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

  • Home
  • SEARCH
  • 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 8871181
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T17:55:23+00:00 2026-06-14T17:55:23+00:00

I would like to have my data in a separate file (same path as

  • 0

I would like to have my data in a separate file (same path as all other files). I am struggling with importing the JSON file. This is what I tried which did not work:

$.getJSON("rezepte.json", function(obj) {
var rezepte = obj.rezepte;
});

update – this is what fianlly worked Thanks a lot for all your help.

var rezepte = $.getJSON("rezepte.json", function(obj) {
rezepte = obj.rezepte;
});

When using this data in the code direcly, all works well:

var rezepte = [
{ "name" : "Eierkopf" , "zutaten" : ["eier", "butter", "kekse"] , "menge" : ["3 Eier", "20g Butter", "5 Kekse"] , "portionen" : 1 , "zubereitung" : ["1. alles", "2. schön", "3. mischen."] },
{ "name" : "Käseschnitte" , "zutaten" : ["käse", "brot"] , "menge" : ["500g Käse", "2 Scheiben geschnittenes Brot"] , "portionen" : 2 , "zubereitung" : ["1. Brotunterseite mit Butter bestreichen (altes Brot verwenden)", "2. Brotoberseite mit Weisswein beträufeln", "3. mit Käse bedecken und würzen", "4. 20min. in vorgeheizten Ofen bei 180 Grad" , "5. nomal öpis"] },
{ "name" : "Gemüse-Auflauf" , "zutaten" : ["lauch"] , "menge" : ["1 Stengel Lauch", "5 Zitronen"], "portionen" : 4 , "zubereitung" : ["1. schneiden", "2. Kochen", "3. essen", "4. xxx", "5. yyy", "6. en guete"] } ];

Saved this as rezepte.json:

{
"rezepte" :

[
{ "name" : "Eierkopf" , "zutaten" : ["eier", "butter", "kekse"] , "menge" : ["3 Eier", "20g Butter", "5 Kekse"] , "portionen" : 1 , "zubereitung" : ["1. alles", "2. schön", "3. mischen."] },
{ "name" : "Käseschnitte" , "zutaten" : ["käse", "brot"] , "menge" : ["500g Käse", "2 Scheiben geschnittenes Brot"] , "portionen" : 2 , "zubereitung" : ["1. Brotunterseite mit Butter bestreichen (altes Brot verwenden)", "2. Brotoberseite mit Weisswein beträufeln", "3. mit Käse bedecken und würzen", "4. 20min. in vorgeheizten Ofen bei 180 Grad" , "5. nomal öpis"] },
{ "name" : "Gemüse-Auflauf" , "zutaten" : ["lauch"] , "menge" : ["1 Stengel Lauch", "5 Zitronen"], "portionen" : 4 , "zubereitung" : ["1. schneiden", "2. Kochen", "3. essen", "4. xxx", "5. yyy", "6. en guete"] }
]

}

unfortunately it still does not work – the $.getJSON results in an array of 3 empty objects only Would be happy to get further help. Thx, Andi

  • 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-14T17:55:25+00:00Added an answer on June 14, 2026 at 5:55 pm

    Sounds like you need to access the rezepte property of the returned object.

    $.getJSON("rezepte.json", function(obj) {
        var rezepte = obj.rezepte;
    });
    

    It wouldn’t be wise to name that argument as json, as it’s not, it’s a JavaScript object (generally).

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

Sidebar

Related Questions

I have some data from log files and would like to group entries by
I have an existing data model. I would like to express this data model
I have data that I would like to compute some statistics with. The data
HI, I would like to have the configuration data for my application stored in
I have some data that I would like to visualize. Each byte of the
I would like to have a method along the lines of setData:(SomeClassName *)data inPosition:(NSInteger)position
I have a data set that that I would like to call in a
I have some data in .cvs. I would like to make a simple barplot
Here's the issue: I have 2 data contexts that I would like to do
I have a data.frame of a time series of data, I would like to

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.