i have attached my json result(http://dpaste.com/12719/) and the view( http://dpaste.com/12718/) that i use to get this result and pass it to the html page called 'results.html' , i am trying to get all the fields to displayed in the html page, but unable to access it, how can i use simplejson in my views.py to pass it to the html and wat do i need.Right now i am getting the field as 'latest_search_list.totalHits' in the html page.
On 6/21/07, Joseph Heck <[EMAIL PROTECTED]> wrote: > > > Without seeing your code, it's hard to know what's happening. It > sounds like you're having a problem using JSON objects with > javascript, so I'll try and throw out a short example and see if that > helps. If this doesn't do it for you, put up the actual javascript > that's causing you the trouble, and we'll see if we can't debug it. > > The example: http://www.djangosnippets.org/snippets/292/ > > This example uses Dojo, the idea being checking to see if a username > is available. Most of the text of that example is pulling all the > parts together, but the critical line to using JSON within the > javascript is: > > arrayData = dojo.json.evalJson(data); > > which evaluates the data and returns it as object literals that you > can then access with dot notation or whatever you use. In my case, I > used the javascript array/dictionary lookup notation to get my simple > "is it there" response and then I spew in some HTML accordingly. > > -joe > > > On 6/20/07, aman r <[EMAIL PROTECTED]> wrote: > > yes, u have understood my problem correctly but the JSON object is not > > recognized in the html page so if i try to say something like list.name > > (where list has my JSON and name is its one of the values present in > that > > list) then it doesnt get recognized, is gives me Type mismatch error , > is > > there any conversion or decode i need to do ? > > > > > > On 6/20/07, Joseph Heck <[EMAIL PROTECTED]> wrote: > > > > > > If I understand correctly, that sounds reasonably doable - what is > > > your question? Taking JSON from whatever source and generating a form > > > in HTML is pretty much straight javascript and/or templating. > > > > > > -joe > > > > > > On 6/20/07, cess <[EMAIL PROTECTED]> wrote: > > > > > > > > Hi All, > > > > I am very new to the Django framework, i have tried using free > > > > admin API , it works fine,so i wanted to design my own page where i > > > > dont interact with database and dont create any models, i rather > call > > > > an JSP page in my view which returns an JSON object, i want to > convert > > > > it into a form which i can use to display in my template ( i.e.,) in > a > > > > form python form or something and access all different fields from > > > > that JSON result. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---