function votar(eid){
alert('inside function');
$.post(baseUrl+"/index/voto",{id:eid},function(e){
alert('after post');
I have this function here. On developer server, I get all working. No problems.
Once I upload to the production server I got only the first alert to show.
$.post(baseUrl+"/index/voto",{id:eid},function(e){
The baseUrl is correct.
The /index/voto is the correct path (the same as dev. server) to the voto method into index controller, id:edid is a json format yes, so, nothing wrong, and at the end, I just have that callback.
What possibilities do we have for the fact that the second alert is not showing on the production environment ?
Later on this same file, I have this function, the the same line of code, and it works perfectly:
function showDetails(eid, elemento){
$.post(baseUrl+"/index/details.campaign",{id:eid},function(e){
The only difference being the server side function it calls, “details.campaign” on one side, “voto” on the other.
Could we state that the issue must rely there, and only there ?
Update:
Here is, ipsis verbis, the full votar function:
function votar(eid) {
$.post(baseUrl+"/index/voto",{id:eid},function(e){
var divMsg = $("#msg");
var colunasFinalistas = $("#colunasFinalistas");
var rodape = $("#rodape");
var botaoVota = $("#votaEmGrande");
var html = "";
//no caso de votar pela primeira vez
if(e.msg == 1){
html = '<img src="'+baseUrl+'/lib/img/obrigadoParticipacao.png" alt="pdf" />';
rodape.removeClass("margemSeparadorRodape");
colunasFinalistas.hide();
}else if(e.msg == 3){
//no caso ja ter votado - se não existir nenhum elemento já:
if ($('#votoJaContabilizado').length == 0) {
botaoVota.after('<p id="votoJaContabilizado">O teu voto já foi contabilizado.</p>');
}
} else if(e.msg == 2){
//no caso da equipa nao existir
html = '<img src="'+baseUrl+'/lib/img/equipaNaoExiste.png" alt="pdf" />';
colunasFinalistas.hide();
} else{
//no caso de outro erro
html = '<img src="'+baseUrl+'/lib/img/erroEstranho.png" alt="pdf" />';
}
if (html != ''){
divMsg.html(html);
divMsg.show();
}
}, 'json');
}
Try this, and tell us what you get: