Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6031831
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T05:14:36+00:00 2026-05-23T05:14:36+00:00

function votar(eid){ alert(‘inside function’); $.post(baseUrl+/index/voto,{id:eid},function(e){ alert(‘after post’); I have this function here. On developer

  • 0
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');

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T05:14:37+00:00Added an answer on May 23, 2026 at 5:14 am

    Try this, and tell us what you get:

    var vote = $.post(baseUrl+"/index/voto",{id:eid},function(e){
        alert('after post');
    });
    vote.error(function(e){
        alert(e.statusText);
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

function uploadify() { $file = $this->input->post('filearray'); $data['json'] = json_decode($file); print_r($data); $name = $this->$json->{'file_name'}; echo
function Obj1(param) { this.test1 = param || 1; } function Obj2(param, par) { this.test2
function MySingletonClass(arg) { this.arr = []; if ( arguments.callee._singletonInstance ) return arguments.callee._singletonInstance; arguments.callee._singletonInstance =
function genTask(elem){ elem.each(function(){ $this=$(this).parent('.cntTasks'); var pattern=/taskId-(.*)$/ var idTask=$this.attr('id').match(pattern); var data='id_task='+idTask[1]; if(typeof jsVar2 !='undefined') data+=jsVar2;
function get() { $.post( 'postchatfame.php', { comment: postchatfamemsg.comment.value, userid: postchatfamemsg.userid.value }, function(output) { $('#walls').html(output).show();
function getMainContent(ID, num, lang){ $.ajax({ type: POST, url: WebMethods.aspx/showMain, data: '{AID: ' + articleID+
(function() { //do stuff })(); EDIT: I originally thought this construct was called a
function validation(reg) { str = document.reg; if (str.name.value == ) { alert(Enter your name);
function msg ($msg) { echo <script type='text/javascript'>alert('$msg');</script>; } if (count($_POST)) { msg('TEST!!!!!'); } <!DOCTYPE
function has_thumbnail_image(&$post) { $content = $post->post_content; return preg_match('/<img[^>]+src=(.*?)[^>]*>/', $content, $results); } I need a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.