Javascript JQuery/Ajax/PHP交叉调用在加载内容时给出未定义的

Javascript JQuery/Ajax/PHP交叉调用在加载内容时给出未定义的,javascript,php,jquery,ajax,Javascript,Php,Jquery,Ajax,我们需要通过服务器将另一个页面的内容加载到我们自己的页面中。不知道怎么走得更远。它从不加载内容,只加载“未定义”一词 提前谢谢 我就是这样得到的: <script> var jQitems = {}; var htmlString = ''; $.ajax({ url: "crosscall/crosscall.php", data: {url: "http://www.beerpuls

我们需要通过服务器将另一个页面的内容加载到我们自己的页面中。不知道怎么走得更远。它从不加载内容,只加载“未定义”一词

提前谢谢

我就是这样得到的:

        <script>
        var jQitems = {};

            var htmlString = '';
    $.ajax({
        url: "crosscall/crosscall.php",
        data: {url: "http://www.beerpulse.com"},
        type: "POST",
        success: function(data) {


            //jQitems.attr = {}; == jQitems['attr'];
            //jQitems.attr.title = ".attr()";


$(data).find(".hentry").each(function(){
                console.log(this);
                var $el = $(this);
                var abbr = $el.attr('data-slug');
                jQitems[abbr] = {};
                var entry = {};
                jQitems[abbr].image = $el.find('.hentry a img.excerpt_thumb wp-post-image').html();
                jQitems[abbr].title = $el.find('.excerpt-title').html();
                jQitems[abbr].description = $el.find('div.entry-summary').filter('div.entry-meta').html();
                htmlString += '<div class="content">'; 
                htmlString += '<img class="afbeelding src="' + jQitems[abbr].image + '">';
                htmlString += '<p class="tekst">';
                htmlString += jQitems[abbr].description + '</p></div>';

                /*$.ajax({
                    url: "crosscall/crosscall.php",
                    data: {url: "http://www.beerpulse.com/" + abbr},
                    type: "POST",
                    success: onDetailSuccess

                });*/
            });
            $('.wrapper').append(htmlString);

        }              
    });

            function onDetailSuccess(data) 
                {
                    var abbr = $(data).find('.abbr'); //verander selectie
                    jQitems[abbr].description = $(data).find('.entry-summary'); //verander selectie

                    var htmlString = '';
                    $.each(jQitems, function(index, item){
                        //...
                    });
                    $('div#result').append(htmlString);
                }
    </script>

var jQitems={};
var htmlString='';
$.ajax({
url:“crosscall/crosscall.php”,
数据:{url:“http://www.beerpulse.com"},
类型:“POST”,
成功:功能(数据){
//jQitems.attr={};==jQitems['attr'];
//jQitems.attr.title=“.attr()”;
$(数据)。查找(“.hentry”)。每个(函数(){
console.log(this);
var$el=$(本);
var缩写=$el.attr('data-slug');
jQitems[abbr]={};
var条目={};
jQitems[abbr].image=$el.find('.hentry a img.extract_thumb wp post image').html();
jQitems[abbr].title=$el.find('.extract title').html();
jQitems[abbr].description=$el.find('div.entry-summary').filter('div.entry-meta').html();
htmlString+='';
htmlString+='';
htmlString+='

'; htmlString+=jQitems[abbr].description+'

'; /*$.ajax({ url:“crosscall/crosscall.php”, 数据:{url:“http://www.beerpulse.com/“+abbr}, 类型:“POST”, 成功:成功 });*/ }); $('.wrapper').append(htmlString); } }); 功能成功(数据) { var abbr=$(数据).find('.abbr');//verander selectie jQitems[abbr].description=$(数据).find('.entry summary');//verander selectie var htmlString=''; $。每个(jQitems,函数(索引,项){ //... }); $('div#result').append(htmlString); }
请告诉我们您试图用此代码实现什么。很抱歉,我很难用正确的英语解释。我们需要使用一个现有的网页,并采取了这方面的内容,并把这在我们的网站。我们必须用老师给我们的PHP脚本来完成。我们需要制作自己的JS/JQuery/Ajax脚本,以便内容显示在我的个人网站上。我设法选择不同的我想要的,并让他们出现在我的控制台,但在我的网站上,他们只是作为一个词'未定义'。这是我的问题。我希望这有助于投标?这对你有用吗<代码>$(“#结果”).load('crosscall/crosscall.php?url=http://www.beerpulse.com,函数(数据){console.log('#result现在应该显示crosscall.php');})