Working on a single-page app and trying to ensure that only part of the
page gets refreshed. Doing some tests using LOAD() that look like this:
*file default/new.html:*
{{extend 'layout.html'}}
{{=LOAD('default', 'new.load',ajax=True)}}
*file default/new.load:*
{{if 'message'in globals():}}
<h3>{{=message}}</h3>
{{pass}}
{{=form}}
I added this detection code to* web2py_ajax.html*:
<script type="text/javascript"><!--
// These variables are used by the web2py_ajax_init function in
web2py_ajax.js (which is loaded below).
var w2p_ajax_confirm_message = "{{=T('Are you sure you want to delete
this object?')}}";
...
window.onload = function() {
console.log('RELOADED ' + Date());
};
//--></script>
But the refresh seems to be called every time I choose the action. However,
when viewing the console output in Chome I get the hoped-for message
starting with:
RELOADED Thu Oct 01 2015 15:36:45 GMT-0700 (PDT)
XHR finished loading: GET "http://127.0.0.1:8000/spa1a/default/new.load"
etc.
What am I doing wrong?
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.