开发者

Why this code works in my localhost and doesn't work online?

this code below works fine in my localhost, and when I upload to internet's server, it doesn't works.

please, any direction to I figure out this problem?

<script type="text/javascript">
    $(document).ready(function(){


        $('ul.pais li .info').css({cursor:'pointer'}).live('click', function(){
            var pais = $('em', this);
            var html2;
            $('.times').slideUp('normal');
            if(!$('.times', pais.parent().parent())[0]){
                pais.parent().append('<span></span>');
                $.post('http://www.horabola.com/times', {cmd:'listaTimes', id: pais.parent().find('img').attr('alt')}, function(data){
                    if(data){
                        html2 = '<div class="times"><ul>';
                        $.each(data, function(i,v){
                        html2   += '<li>'
                                 + '    <a href="http://www.horabola.com/time/'+v.url+'" title="'+v.nome+'">'
                                 + '        <img src="http://www.horabola.com/imagens/es_'+v.id+'.jpg" title="'+v.nome+'" alt="'+v.nome+'"/>'
                                 + '        <strong>'+v.nome+'</strong>'
                                 + '    </a>'
                                 + '</li>';
                        });
                        html2 += '</ul><br class="clear"/></div>';
                        pais.parent().after(html2).parent().find('.times').slideTog开发者_运维知识库gle();
                        $('ul.pais li .info span').remove();
                    } else {
                        html2 = '<div class="times"><span>Nenhum registro encontrado?!?</span></div>';
                        pais.parent().after(html2).parent().find('.times').slideToggle();
                        $('ul.pais li .info span').remove();
                    }
                }, 'json');
            } else {
                if(pais.parent().after(html2).parent().find('.times').css('display') == 'block')
                    pais.parent().after(html2).parent().find('.times').slideUp();
                else
                    pais.parent().after(html2).parent().find('.times').slideToggle();
            }
        });
    });
</script>


Nobody can tell you why without further information. The response on the post-requests is always empty(no matter if using AJAX or another method), so you have to check the serverside scripts for the reason.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜