submit custom ajax
Hello I am new to the framework 7 in jquery I could customize ajax send post by this way (JQuery.Deferred)
//enviar datos ajax
//datos para enviar por post
var datosPost = {
'tokentx' : jQuery('#formkey').val(),
'cuentaclietx' : jQuery('#txcuentaclie').val(),
'nomclietx' : jQuery('#txrazonsocialclie').val()
};
var enviar = jQuery.ajax({
url: “/domain/page.php”,
type: “POST”,
data: datosPost,
dataType: “json”,
timeout: 60000//60 sec
});
//si fue satisfactorio
enviar.done(function(json)
{
});
//hubo un error jqXHr, textStatus, errorThrown
enviar.fail(function(jqXHr, textStatus, errorThrown)
{
});
//siempre me ejecuto
enviar.always(function()
{
});
I do not see in framework7 something like that I hope you can help me regards!!
my solution using traditional Ajax not Referred
$$.ajax({
myApp.showPreloader('Buscando cuenta');
url: ‘datos.php’,
method: ‘POST’,
dataType: ‘json’,
success: function(data)
{
},
error: function(xhr)
{
},
complete: function()
{
myApp.hidePreloader();
}
});
is correct soluction??
regards!! welcome your comments
There is no deferred objects/methods in Dom7 ajax, you need to use callbacks as a parameters or Ajax events or manual/custom promises (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.