how it can be known when LOAD() in web2py is success -
how it can be known when LOAD() in web2py is success -
using load() in controller below:
def showresult(): msg='' result=load('rescontroller','res.load',ajax=true) if 'pass' in result: msg='congratulations, you've passed' response.flash= msg
found this: when load() invoked (and before receive response res.load) passes "loading..." result variable in turns impact if condition.
question this: there way create if status works after load() receive response?
you misunderstanding how load
works. html helper generates html div includes special attributes trigger javascript in browser when containing page loads (the javascript makes ajax phone call specified action, returns response browser). not execute http request within controller code , homecoming response there, cannot ajax response in controller generates load
helper.
note, load
returns div
helper, , html helpers deed lists respect components. because div
initiated text "loading...", acts if list ['loading...']
. so, when if 'pass' in result
, status false
.
to farther help, have clarify workflow should , happening in rescontroller/res. perhaps action 1 needs homecoming flash message browser.
load web2py
Comments
Post a Comment