salve,
devo poter eliminare un ordine chiamando un api / url esterna ,dominioesterno/api/ordine/chiudi/?utente=email, ma non sembra funzionare ecco il mio script jquery che agisce cliccando il pulsante order/send
codice:
$(function() {
$(" button[name='order-send']").click( function()
{
var id = $("button[name='order-send']").attr("id");
var targa = $("input[id='targa']").val();
if(!targa){
$.alert({
title: 'N° Telaio mancante',
content: 'Here a simple guide to show configurator issues',
theme: 'my-theme',
animation: 'zoom',
content: '<p>Non hai inserito N° Telaio</p>' +
'<p>Clicca Ritorna per chiudere questa finestra ed inserirlo.</p> ',
closeAnimation: 'bottom',
backgroundDismiss: true,
buttons: {
okay: {
text: 'Ritorna',
btnClass: 'btn-success',
action: function() {
}
}
}
});
return false;
}
$.alert({
title: 'Invio Ordine',
content: 'Here a simple guide to show configurator issues',
theme: 'green',
animation: 'zoom',
content: '<p>Cliccando "Invia" il tuo ordine verrà finalizzato.</p>' +
'<p>Ti verrà inviata e-mail di conferma.</p><p>Riceverai risposta in tempi brevissimi</p> ',
closeAnimation: 'bottom',
backgroundDismiss: true,
buttons: {
okay: {
text: 'Invia',
btnClass: 'btn-success',
action: function() {
//$("button[name='order-send']").parents('tr').first().remove();
var user_email = $("#email").val();
var href = "miodominio/get_url_spare_parts.php?user=" + user_email
$.ajax({
type:"GET",
dataType: 'html',
url: href,
success: function(res){
var table_html = '<table width="100%">' + res + '</table>';
var marchio = $("#marchio").val();
var userid = $("#userid").val();
var fname = $("#fname").val();
var lname = $("#lname").val();
var email = $("#email").val();
var targa = $("#targa").val();
var state = $("#state").val();
var colore = $("#colore").val();
var nota = $("#nota").val();
$.ajax({
type: "POST",
url: "miodominio/areariservata/ajax/ricambi.quote.php",
beforeSend: function(){
// Show image container
$("#cover").show();
},
data: "&userid=" + userid + "&inputName=" + fname + "&inputLastName=" + lname + "&inputState=" + state + "&inputEmail=" + email + "&inputTarga=" + targa + "&colore=" + colore + "¬a=" + nota + "&marchio=" + marchio + "&table="+ table_html,
success: function(res){
$.ajax({
type: "GET",
dataType: "html",
//QUI NON FUNZIONA!!!
url:'dominioesterno/api/ordine/chiudi/?utente='+ email
});
$.alert("<p>"+ res +"</p><br />");
$("#cover").hide();
window.location.href='miodominio/areaoff/account.php';
}
})
}
});
}
}
}
});
return false;
}
);
});
GRAZIE delle eventuali dritte.
Un saluto al Forum