Yes I want to execute a view here is the example code:
Controller:
from json import dumps as jdumps
def abtest():
alist = ["it's ok","I'm late"]
return dict(stra='abcd', obj=jdumps(alist))
View:
{{extend 'layout.html'}}
<h1>Ceci est le modèle test/abtest.html </h1>
<h1 id='result'>
RESULT
</h1>
<script>
var o= "{{=obj}}";
var po = JSON.parse(o);
console.log(po);
jQuery("#result").html(po);
</script>
JSON decode error:
SyntaxError: JSON.parse: unexpected character at line 1 column 2 of the
JSON data
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.