You're doing it right, but there are a couple of things to keep in mind. 
Using $.post(url, {input_n: input_number}); is easier than using $.ajax, but 
that's merely preference. The other thing you should know is that if a 
web2py ticket is generated during an AJAX call, you will not know about it. 
The call will appear to do nothing, which sounds like what you described.

Whenever I make an AJAX call, this is how I usually do it:

jQuery.post(url, {myvar: myvalue}, function(data) {
    // do something with the returned data from server (only gets called if 
call was successful).
}).error(function(data) {
    // error is usually HTML, so convert it to plain text for the alert() 
function.
    alert(data.replace(/(<.*?>)/ig,""));
});

This way, you will know if AJAX was successful or failed.

Reply via email to