[web2py] Re: Getting JSON data from a select into Javascript

2013-10-15 Thread Derek
Anyway, that being said, you might need to put your {{=getitemtags( results.update_form.custom.dspval.id)}} in single quotes. I might also change it to this: '{{=XML(=getitemtags(results.update_form.custom.dspval.id))}}' . On Tuesday, October 15, 2013 11:53:39 AM UTC-7, Derek wrote: > > This que

[web2py] Re: Getting JSON data from a select into Javascript

2013-10-15 Thread Derek
This question also comes up a lot, there should be a FAQ and this should be in it... getitemtags That is your function. You want to have jQuery call your function, and parse the json... instead of trying to mix javascript in your view (which you are lucky if it works at all) you should just w

[web2py] Re: Getting JSON data from a select into Javascript

2013-10-14 Thread Alan Etkin
> > Does anyone know how to cleanly pas json data to the client? > How about jdata = db(query).select(...).as_json() Then the js part: {{=SCRIPT(""" var myObject = %(jdata)s; """ % dict(jdata=jdata))}} -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github