Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > Web Development
You last visited: Today at 19:16

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



JSON Rezeptdatenbank!

Discussion on JSON Rezeptdatenbank! within the Web Development forum part of the Coders Den category.

Reply
 
Old   #1
 
Biboja's Avatar
 
elite*gold: 0
Join Date: Jul 2009
Posts: 1,121
Received Thanks: 420
JSON Rezeptdatenbank!

Hey,

Ich muss fürs Studium eine "virtuelle" Küche via Canvas etc. erstellen.
Die Rezepte würde ich gerne mit Json machen.
Hat jmd. evtl eine art Grundgerüst für mich?

Z.b. erst Rezeptname dann kommen die Zutaten (Reihenfolge beachten)

Gruß
Biboja is offline  
Old 06/20/2012, 20:37   #2

 
マルコ's Avatar
 
elite*gold: 1329
Join Date: Jun 2009
Posts: 1,873
Received Thanks: 960
Wenn ich das machen müsste, dann würde ich das so machen, dass ich jedes Rezept als array speichere.
Code:
{"recipe":[
             { "ind1":[
                        {"name":"apples","amount":"3"}
                        ]},
             { "ind2":[
                        {"name":"bananas","amount":"5"}
                        ]},
             { "ind3":[
                        {"name":"sugar","amount":"300","value":"gramm"}
                        ]}
              ]}
マルコ is offline  
Thanks
1 User
Old 06/20/2012, 20:40   #3
 
Biboja's Avatar
 
elite*gold: 0
Join Date: Jul 2009
Posts: 1,121
Received Thanks: 420
Okey, ja so hatte ich es auch im Kopf..
das ind1-3 stellt dann die jeweilige Zutat da?!
Biboja is offline  
Old 06/21/2012, 18:06   #4
 
elite*gold: 31
Join Date: Jun 2012
Posts: 89
Received Thanks: 8
ja, sieht so aus^^
Code:
{"recipe":[ // name des rezeptes
             { "ind1":[
                        {"name":"apples","amount":"3"} // zutat 1
                        ]},
             { "ind2":[
                        {"name":"bananas","amount":"5"} // zutat 2
                        ]},
             { "ind3":[
                        {"name":"sugar","amount":"300","value":"gramm"} // zutat 3
                        ]}
              ]}
Steckdose9000 is offline  
Old 06/21/2012, 18:54   #5

 
マルコ's Avatar
 
elite*gold: 1329
Join Date: Jun 2009
Posts: 1,873
Received Thanks: 960
Hi, jo, sry, ind steht für ingredient.
Das Array kannst du dann mit foreach durchgehen.

Code:
Array.prototype.foreach = function($callback)
{
  for(var k=0; k < this.length; k++)
    $callback(k, this[k]);
};
マルコ is offline  
Thanks
1 User
Reply


Similar Threads Similar Threads
.json files!
10/28/2013 - Facebook - 5 Replies
Is it Possible to Change some data in .json files I was gonna edit Dragons of atlantis .json files ! Just Like BYm gonna map it then everything is like WTF!!
JQuery -JSON
11/28/2011 - General Coding - 0 Replies
Hey, mein Freund hat ein Problem und ich wollte mal wissen, ob ihr da helfen könnt? Die Fragestellung ist sehr kurz und ich persönlich kann damit nichts anfangen , aber hier die Frage: Wie krieg ich beim Fullcalendar in JQuery nen Datensatz per JSON rein?
Komplexer JSON String
12/09/2010 - General Coding - 6 Replies
Huhu Kleine Herausforderung für euch: Ich habe einen JSON String. Jetzt will ich den JSON String in eine geeignete Datenstruktur in Java impementieren. Ein Objekt (mit ner Klasse als Vorlage), dynamische Arrays, oder ne Hashmap. Der Json String ist ziemlich komplex: var game_data =...



All times are GMT +1. The time now is 19:18.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.