In my app, I have a view that includes this line as part of a table:
<td>{{=A('Callback test', callback=URL('jquery_test'), target=':eval')}}</td>
jquery_test is a method that does this:
def jquery_test():
return "jQuery('#option_list').html('Example jQuery string');"
This worked in an earlier version of web2py: the string "Example jQuery string" was correctly injected into the view's option_list divison.
This morning, realizing I was way behind on web2py, I upgraded to 2.9.5 stable. Now, the above code redirects the returned string: I get a blank view with "jQuery('#option_list').html('Example jQuery string');" on it. The URL for the page is
"http://127.0.0.1:8000/myApp/default/jquery_test"
I can't say what upgrade changed this behavior, as I went from 2.2-something to 2.9.5. Any ideas what changed and how to correct it?
Thanks.
Edited with some additional information...I have updated the web2py.js (and other .js and .css files as appropriate) as suggested by Anthony below.
Using this callback in the view file:
<td>{{=A('Callback test', callback=URL('jquery_test'), target='options_list')}}</td>
correctly calls the jquery_test method and populates the DIV id='options_list'
Using this callback:
<td>{{=A('Callback test', callback=URL('jquery_test'), target=':eval')}}</td>
does not call the jquery_test method. It never executes at all.
I'm hopeful this provides some additional clues.