AJAX request does not work when on server ... locally runs normal ... Anyone have any idea what it can be?
function SalvarPedido() {
//Data
var data = $("#Data").val();
//Cliente
var cliente = $("#Cliente").val();
//Valor
var valor = $("#Valor").val();
var token = $('input[name="__RequestVerificationToken"]').val();
var tokenadr = $('form[action="/Pedido/Create"] input[name="__RequestVerificationToken"]').val();
var headers = {};
var headersadr = {};
headers['__RequestVerificationToken'] = token;
headersadr['__RequestVerificationToken'] = tokenadr;
//Gravar
var url = "/Pedido/Create";
$.ajax({
url: url
, type: "POST"
, datatype: "json"
, headers: headersadr
, data: { Id: 0, Data: data, Cliente: cliente, Valor: valor, __RequestVerificationToken: token }
, success: function (data) {
if (data.Resultado > 0) {
ListarItens(data.Resultado);
}
}
});
}