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

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -