Note that there are some explanatory texts on larger screens.

plurals
  1. POparsing nested JSON String objects with JQuery/PHP?
    primarykey
    data
    text
    <p>This is the page I'm working on.... <a href="http://fremontchurch.net/json_test/" rel="nofollow">http://fremontchurch.net/json_test/</a></p> <p>This is the json <a href="http://fremontchurch.net/json_test/posts.php" rel="nofollow">http://fremontchurch.net/json_test/posts.php</a></p> <p>I'm trying to to have a list of tracks names listed and linked through simple html link <code>&lt;a href="URL_GOES_HERE"&gt;TRACK NAME GOES HERE&lt;/a&gt;</code> to its url</p> <p>i got everything else in order its just the nested part keeps coming up "[object Object],[object Object],[object Object]"... and so on... each nest has two items a track name and url... what would be the correct way to do this?</p> <p>heres one object from my json...</p> <pre><code>{ "id":"All Things Are Possible", "key":"All Things Are Possible", "doc":"All Things Are Possible", "album":"All Things Are Possible", "artwork":"http://godsgypsychristianchurch.net/music_artwork/DEFAULT_COVER2.png", "baseurl":"http://www.godsgypsychristianchurch.net/music", "church":"Atlanta GA", "des":"All Things Are Possible from the Atlanta GA Church, Pastor Nick White", "tracks":[ {"name":"1 Intro", "url":"/Atlanta%20GA/All%20things%20are%20possible/01%20Intro.mp3"}, {"name":"2 Wo si O Drom", "url":"/Atlanta%20GA/All%20things%20are%20possible/02%20Wo%20si%20O%20drom.mp3"}, {"name":"3 Nas Murrgo Shov", "url":"/Atlanta%20GA/All%20things%20are%20possible/03%20Nas%20murrgo%20shov.mp3"}, {"name":"4 To Cho Vos", "url":"/Atlanta%20GA/All%20things%20are%20possible/04%20To%20cho%20vos.mp3"}, {"name":"5 Tu Son Kai Sastridas", "url":"/Atlanta%20GA/All%20things%20are%20possible/05%20Tu%20son%20kai%20sastridas.mp3"}, {"name":"6 Now I Am Strong", "url":"/Atlanta%20GA/All%20things%20are%20possible/06%20Now%20I%20am%20strong.mp3"}, {"name":"7 Sorr Nevee", "url":"/Atlanta%20GA/All%20things%20are%20possible/07%20Zorr%20nevee.mp3"}, {"name":"8 Preaching", "url":"/Atlanta%20GA/All%20things%20are%20possible/08%20Preaching.mp3"}, {"name":"9 Arkadyan Amey", "url":"/Atlanta%20GA/All%20things%20are%20possible/09%20Arkadyan%20amey.mp3"}, {"name":"10 O Christo Ka Wudarr", "url":"/Atlanta%20GA/All%20things%20are%20possible/10%20O%20Christo%20ka%20wudarr.mp3"}, {"name":"11 Eloi, Eloi", "url":"/Atlanta%20GA/All%20things%20are%20possible/11%20Eloi%2C%20Eloi.mp3"}, {"name":"12 Amadow Dell", "url":"/Atlanta%20GA/All%20things%20are%20possible/12%20Amadow%20Dell.mp3"}, {"name":"13 Sastiar Amey Devla", "url":"/Atlanta%20GA/All%20things%20are%20possible/13%20Sastiar%20amey%20Devla.mp3"}, {"name":"14 Tu Skepeese", "url":"/Atlanta%20GA/All%20things%20are%20possible/14%20Tu%20skepeese.mp3"}, {"name":"15 Dov Ma Godgee", "url":"/Atlanta%20GA/All%20things%20are%20possible/15%20Dov%20ma%20godgee.mp3"}, {"name":"16 The Lord is my strength", "url":"/Atlanta%20GA/All%20things%20are%20possible/16%20The%20Lors%20is%20my%20strength.mp3"} ] } </code></pre> <p>heres all my code to the html/jquery/php</p> <pre><code>&lt;html&gt; &lt;body&gt; &lt;div id="content"&gt; &lt;/div&gt; &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready(function(){ var url="posts.php"; $.getJSON(url,function(json){ $.each(json.posts,function(i,post){ $("#content").append( '&lt;div class="post"&gt;'+ '&lt;h1&gt;'+post.album+'&lt;/h1&gt;'+ '&lt;p&gt;&lt;img src="'+post.artwork+'"width="250"&gt;&lt;/img&gt;&lt;/p&gt;'+ '&lt;p&gt;&lt;strong&gt;'+post.church+'&lt;/strong&gt;&lt;/p&gt;'+ '&lt;p&gt;Description: &lt;strong&gt;'+post.des+'&lt;/strong&gt;&lt;/p&gt;'+ '&lt;p&gt;Base url: &lt;em&gt;'+post.baseurl+'&lt;/em&gt;&lt;/p&gt;'+ '&lt;p&gt;Tracks: &lt;li&gt;'+post.tracks+'&lt;/li&gt;&lt;/p&gt;'+ '&lt;hr&gt;'+ '&lt;/div&gt;' ); }); }); }); &lt;/script&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>please reply will full code because I'm kinda new to this kind of coding and sometimes i done know where to put it... any help will be very much appreciated, thank you... </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload