def function_A():
return {'something':'blah blah'}
def function_B():
return {another_thing}
then in function_A.html you can use:
{{=something}} {{=LOAD(URL(r=request,f='function_B'),ajax=True)}}
On May12, 4:16am, Keith Edmunds <[email protected]> wrote:
> I was to display a form using Ajax in response to a click on a link on the
> page. I have tried putting this in the view:
>
> <a href="#" onclick="ajax(
> '{{=URL(request.application,
> 'todo',
> 'new')}}',
> [], 'DetailArea')" />New todo
> </a>
>
> with this in the controller:
>
> def new():
>
> return = LOAD('todo','todo_form',ajax=True)
>
> def todo_form():
> form = SQLFORM(db.tasks,fields=['priority','subject','duedate'])
> if form.accepts(request.vars,session):
> session.flash = 'record inserted'
> redirect(URL(request.application,'default','index'))
> return form
>
> ...but that doesn't work.
>
> I don't think I've fully understood how LOAD works - can someone point me
> in the right direction, please?