Hello,
I hope you can help me with this. I have a javascript function call inside
my index.html page.
function callback1(response, status) {
if (status != google.maps.DistanceMatrixStatus.OK) {
alert('Error was: ' + status);
} else {
var distArrayjs = new Array();
var duratArrayjs = new Array();
for (var i = 0; i < response.rows.length; i++) {
for (var j = 0; j < response.rows[i].elements.length; j++) {
var distance = response.rows[i].elements[j].distance.value;
var duration = response.rows[i].elements[j].duration.value;
distArrayjs.push(distance)
duratArrayjs.push(duration)
}
}
$.ajax({
type: 'POST',
url: '{{=URL('default', 'result1')}}',
data: JSON.stringify({dist: distArrayjs,dura: duratArrayjs}),
dataType: 'json'
});
}
}
The javascript function has a callback that send some array to controller
function 'result1', but the view segunda.html is not shown. Why is this?
def result1 ():
session.temparray1 = json.loads(request.body.read())
redirect(URL('segunda'))
return dict()
def segunda():
print 'ccccccc'
return dict()
--
---
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/groups/opt_out.