ok i solved it, it shld be something like { "departments": { "department": {"ID": 1, "Name": "Physics"}, "department": {"ID": 2, "Name": "Chemistry" }, "department": {"ID": 3, "Name": "Biology"},}}
instead, use of {} and "departments": d: {xxx}, d: {yyy}, d: {zzz} am i right to say all these are required? {} and departments and department naming for the "objects"? On Mar 26, 9:59 pm, iceangel89 <iceange...@gmail.com> wrote: > i still cant out put anything even with a simple alert(json); > > in firebug i see that ... below ... is returned > > [ > {"Value": 1, "Item": "Physics"}, > {"Value": 2, "Item": "Chemistry"}, > {"Value": 3, "Item": "Biology"} > ]; > > On Mar 26, 5:34 pm, jakenoble <j...@jakenoblewebs.co.uk> wrote: > > > Shouldn't your JSON return values be double quoted"? > > > [ {"Value": 1, "Item": "Physics"}, {"Value": 2, "Item": "Chemistry"}, > > {"Value": 3, "Item": "Biology"} ]; > > > On Mar 26, 9:16 am, iceangel89 <iceange...@gmail.com> wrote: > > > > i am trying to load json. but it seems like its not working. nothing > > > is alerted. supposed to be the case? > > > > <script type="text/javascript"> > > > $(function() { > > > $.getJSON("data.js", function (json) { > > > alert(json); > > > });}); > > > > </script> > > > > data.js > > > [ {Value: 1, Item: Physics}, {Value: 2, Item: Chemistry}, {Value: 3, > > > Item: Biology} ];