我的jQuery警报()没有显示什么是应该的,它包括我的index.php文件


My jQuery alert() is not showing what is supposed, its including my index.php file

我有一个分页,我只做与php,但现在我试图做我的分页使用ajax和一些淡出效果。

我有这个链接在我的index.php传递我的BASE,那是我的http://localhost/项目url到jQuery:

<link rel="nofollow" title="base" href="<?php echo BASE; ?>" />

然后我有我的jQuery函数工作时,我点击我的分页链接:

$(function(){
   base = $('link[title="base"]').attr('href');
   urlaction    = base+'/actions'; 
   alert(urlaction);   
$('#body-content').on('click','.paginator a',function(){    
        if($(this).hasClass('active')){
            return false;
        }else{
            $('#body-content .paginator span').css({color:'#FFF','border-color':'#fff'});
            $('#body-content .paginator a').removeClass('active');
            $(this).addClass('atv');
            var url  = $(this).attr('href');
            var data = url.lastIndexOf('/') + 1;
            var data = url.substr(data);
            $('#body-content .news').fadeTo(500,'0.2');
            $.post(urlaction,{action:'article_pagination',page:data},function(pagination){              
                alert(pagination);
                $('html, body').delay(500).animate({scrollTop:$('h2').offset().top},500);
                window.setTimeout(function(){
                        $('#body-content').html(pagination);
                        $('#body-content .news').fadeTo(500,'1');
                },600);
            });         
        }   
        return false;
    });
});

如果我警告我的alert(urlaction),我得到我的localhost/project/actions,所以它是正确的,它是我的url到我的actions.php文件。

但是当我执行alert(pagination);我得到我的警报与所有的代码,我有在我的index.php警报框内,所以它似乎没有得到正确的路径到我的动作。php文件。但是路径是正确的…

你看到这里有什么问题了吗?

我的警告显示如下:

<!DOCTYPE html...>
<html xlmlns>

…所有index。php内容

我猜你在BASE之前错过了$,并且看到一个错误页面提醒你返回该信息。