$.getJSON( "url_of_json_request", function(json) { $.each(json, function(i) { json[i] // current top level index }) } )
On Jul 22, 7:30 pm, Ajay Sharma <sharmaa...@gmail.com> wrote: > even am having issue with a simple GET request using the GETJSON > method...could anyone please provide me with the sample code ? > > On Thu, Jul 23, 2009 at 4:58 AM, MorningZ <morni...@gmail.com> wrote: > > > "I want to parse it with jquery , I searched in the web but it's seems > > my json file is a bite complicated" > > > What is that supposed to mean? *what do you want to accomplish?* "i > > want to parse" doesn't really mean anything > > > and other than there are a lot of characters, there's nothing overly > > complicated about it > > > the $.each method will walk key/value pairs and the array members of > > the object (and that's all that is, an object, there's nothing more > > complex than that) > > > On Jul 22, 6:18 pm, James <james.gp....@gmail.com> wrote: > > > What exactly do you want to do? How is the JSON content stored? In a > > > separate file? On the document? > > > Is it introduced through jQuery's getJSON()? Is it stored as a string > > > in some variable? > > > > On Jul 22, 5:17 am, Abraham Boray <abrahambo...@gmail.com> wrote: > > > > > As U can see guys , I got that json structure , & I want to parse it > > > > with jquery , I searched in the web but it's seems my json file is a > > > > bite complicated :S > > > > > here is the picture more clear thatn the file down ! > >http://www.zshare.net/image/63013802b34a7372/ > > > > > Here is my plane JSON file > > > > [{"Post":{"id":"1","category_id":"1","title":"CSS > > > > Mastering","date":"2009-07-21 22:40:00","content":"How 2 CSS Master in > > > > 5 Days :D ,This association creation and destruction is done using the > > > > CakePHP model bindModel() and unbindModel() methods. (There is also a > > > > very helpful behavior called \"Containable\", please refer to manual > > > > section about Built-in behaviors for more information). Let's set up a > > > > few models so we can see how bindModel() and unbindModel() work. We'll > > > > start with two models: This association creation and destruction is > > > > done using the CakePHP model bindModel() and unbindModel() methods. > > > > (There is also a very helpful behavior called \"Containable\", please > > > > refer to manual section about Built-in behaviors for more > > > > information). Let's set up a few models so we can see how bindModel() > > > > and unbindModel() work. We'll start with two models: This association > > > > creation and destruction is done using the CakePHP model bindModel() > > > > and unbindModel() methods. (There is also a very helpful behavior > > > > called \"Containable\", please refer to manual section about Built-in > > > > behaviors for more information). Let's set up a few models so we can > > > > see how bindModel() and unbindModel() work. We'll start with two > > > > models: ","visible":"1"},"Category":{"id":"1","name":"CSS","Post": > > > > [{"id":"1","category_id":"1","title":"CSS > > > > Mastering","date":"2009-07-21 22:40:00","content":"How 2 CSS Master in > > > > 5 Days :D ,This association creation and destruction is done using the > > > > CakePHP model bindModel() and unbindModel() methods. (There is also a > > > > very helpful behavior called \"Containable\", please refer to manual > > > > section about Built-in behaviors for more information). Let's set up a > > > > few models so we can see how bindModel() and unbindModel() work. We'll > > > > start with two models: This association creation and destruction is > > > > done using the CakePHP model bindModel() and unbindModel() methods. > > > > (There is also a very helpful behavior called \"Containable\", please > > > > refer to manual section about Built-in behaviors for more > > > > information). Let's set up a few models so we can see how bindModel() > > > > and unbindModel() work. We'll start with two models: This association > > > > creation and destruction is done using the CakePHP model bindModel() > > > > and unbindModel() methods. (There is also a very helpful behavior > > > > called \"Containable\", please refer to manual section about Built-in > > > > behaviors for more information). Let's set up a few models so we can > > > > see how bindModel() and unbindModel() work. We'll start with two > > > > models: ","visible":"1","Category":{"id":"1","name":"CSS"},"Comment": > > > > [{"id":"2","post_id":"1","date":"2009-07-22 14:10:00","content":"Nice > > > > TUTO ,Keep it up Dude!","userName":"Reda","a_url":"http:\/\/ > > > > k...@hani.bikhir","e_mail":"ma...@gmailika.hy","showMail":"1"}, > > > > {"id":"6","post_id":"1","date":"2009-07-22 14:38:00","content":"Nice > > > > TUTO ,Keep it up Dude!","userName":"reda","a_url":"http:\/\/ > > > > url.com","e_mail":"m...@mail.fr","showMail":"1"}]}, > > > > {"id":"2","category_id":"1","title":"Beginning CSS","date":"2009-07-21 > > > > 22:41:00","content":"Courses 4 Dummies . Beginning > > > > CSS","visible":"1","Category":{"id":"1","name":"CSS"},"Comment": > > > > [{"id":"3","post_id":"2","date":"2009-07-22 14:16:00","content":"Nice > > > > CSS tut ;)","userName":"Talal","a_url":"http:\/\/ > > > > rwina.talal.com","e_mail":"mail...@gtol.de > > ","showMail":"1"}]}]},"Comment": > > > > [{"id":"2","post_id":"1","date":"2009-07-22 14:10:00","content":"Nice > > > > TUTO ,Keep it up Dude!","userName":"Reda","a_url":"http:\/\/ > > > > k...@hani.bikhir","e_mail":"ma...@gmailika.hy","showMail":"1","Post": > > > > {"id":"1","category_id":"1","title":"CSS Mastering","date":"2009-07-21 > > > > 22:40:00","content":"How 2 CSS Master in 5 Days :D ,This association > > > > creation and destruction is done using the CakePHP model bindModel() > > > > and unbindModel() methods. (There is also a very helpful behavior > > > > called \"Containable\", please refer to manual section about Built-in > > > > behaviors for more information). Let's set up a few models so we can > > > > see how bindModel() and unbindModel() work. We'll start with two > > > > models: This association creation and destruction is done using the > > > > CakePHP model bindModel() and unbindModel() methods. (There is also a > > > > very helpful behavior called \"Containable\", please refer to manual > > > > section about Built-in behaviors for more information). Let's set up a > > > > few models so we can see how bindModel() and unbindModel() work. We'll > > > > start with two models: This association creation and destruction is > > > > done using the CakePHP model bindModel() and unbindModel() methods. > > > > (There is also a very helpful behavior called \"Containable\", please > > > > refer to manual section about Built-in behaviors for more > > > > information). Let's set up a few models so we can see how bindModel() > > > > and unbindModel() work. We'll start with two models: > > > > ","visible":"1","Category":{"id":"1","name":"CSS"},"Comment": > > > > [{"id":"2","post_id":"1","date":"2009-07-22 14:10:00","content":"Nice > > > > TUTO ,Keep it up Dude!","userName":"Reda","a_url":"http:\/\/ > > > > k...@hani.bikhir","e_mail":"ma...@gmailika.hy","showMail":"1"}, > > > > {"id":"6","post_id":"1","date":"2009-07-22 14:38:00","content":"Nice > > > > TUTO ,Keep it up Dude!","userName":"reda","a_url":"http:\/\/ > > > > url.com","e_mail":"m...@mail.fr","showMail":"1"}]}}, > > > > {"id":"6","post_id":"1","date":"2009-07-22 14:38:00","content":"Nice > > > > TUTO ,Keep it up Dude!","userName":"reda","a_url":"http:\/\/ > > > > url.com","e_mail":"m...@mail.fr","showMail":"1","Post": > > > > {"id":"1","category_id":"1","title":"CSS Mastering","date":"2009-07-21 > > > > 22:40:00","content":"How 2 CSS Master in 5 Days :D ,This association > > > > creation and destruction is done using the CakePHP model bindModel() > > > > and unbindModel() methods. (There is also a very helpful behavior > > > > called \"Containable\", please refer to manual section about Built-in > > > > behaviors for more information). Let's set up a few models so we can > > > > see how bindModel() and unbindModel() work. We'll start with two > > > > models: This association creation and destruction is done using the > > > > CakePHP model bindModel() and unbindModel() methods. (There is also a > > > > very helpful behavior called \"Containable\", please refer to manual > > > > section about Built-in behaviors for more information). Let's set up a > > > > few models so we can see how bindModel() and unbindModel() work. We'll > > > > start with two models: This association creation and destruction is > > > > done using the CakePHP model bindModel() and unbindModel() methods. > > > > (There is also a very helpful behavior called \"Containable\", please > > > > refer to manual section about Built-in behaviors for more > > > > information). Let's set up a few models so we can see how bindModel() > > > > and unbindModel() work. We'll start with two models: > > > > ","visible":"1","Category":{"id":"1","name":"CSS"},"Comment": > > > > [{"id":"2","post_id":"1","date":"2009-07-22 14:10:00","content":"Nice > > > > TUTO ,Keep it up Dude!","userName":"Reda","a_url":"http:\/\/ > > > > k...@hani.bikhir","e_mail":"ma...@gmailika.hy","showMail":"1"}, > > > > {"id":"6","post_id":"1","date":"2009-07-22 14:38:00","content":"Nice > > > > TUTO ,Keep it up Dude!","userName":"reda","a_url":"http:\/\/ > > > > url.com","e_mail":"m...@mail.fr","showMail":"1"}]}}]},{"Post": > > > > {"id":"2","category_id":"1","title":"Beginning CSS","date":"2009-07-21 > > > > 22:41:00","content":"Courses 4 Dummies . Beginning > > > > CSS","visible":"1"},"Category":{"id":"1","name":"CSS","Post": > > > > [{"id":"1","category_id":"1","title":"CSS > > > > Mastering","date":"2009-07-21 22:40:00","content":"How 2 CSS Master in > > > > 5 Days :D ,This association creation and destruction is done using the > > > > CakePHP model bindModel() and unbindModel() methods. (There is also a > > > > very helpful behavior called \"Containable\", please refer to manual > > > > section about Built-in behaviors for more information). Let's set up a > > > > few models so we can see how bindModel() and unbindModel() work. We'll > > > > start with two models: This association creation and destruction is > > > > done using the CakePHP model bindModel() and unbindModel() methods. > > > > (There is also a very helpful behavior called \"Containable\", please > > > > refer to manual section > > ... > > read more »