Here is how I do it:
controller:
@service.json
def get_days():
return ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday",
"Friday", "Saturday"]
javascript:
jQuery.getJSON("{{=URL(r=request,f='call',args=
['json','get_days'])}}",
function(msg){
jQuery.each(msg, function(){ jQuery("#target").append(this + "<br /
>"); } )
}
);
Hope that helps.
On Sep 15, 10:47 am, Bernardo Botelho <[email protected]> wrote:
> Hello everyone,
>
> I'm using the post ajax function with jQuery sending info to a web2py
> controller so he can handles with the database manipulation according the
> received information from the jQuery post. For the callback function, I need
> tow send a list with tow indexes (0 and 1) with 2 strings. So i created the
> list at the controller and returned it expecting that the callback function
> will understand it as an array of two elements. But it received an string
> such as ['value1','value2']. I would like to know if there is a way to
> return to the callback function that list and it receives and compreend that
> as an array.
>
> Thanks
>
> --
> Bernardo Botelho Fontes
> [email protected]
> (21) 9629 1621
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---