If you benefit from web2py hope you feel encouraged to pay it forward by contributing back to society in whatever form you choose!

In your controller:

@service.json
def get_days():
    return ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]

And in your view:

jQuery.getJSON("{{=URL(r=request,f='call',args=['json','get_days'])}}",
        function(msg){
           jQuery.each(msg, function(){ jQuery("#target").append(this + "<br />"); } )
        }
 );

That's it!

Related slices

Comments (1)


Hosting graciously provided by:
Python Anywhere