Javascript 我没有按任何键,我现在就挂了,我已经纠正了错误,你能帮我只滑动新插入的原始数据而不是整个列表吗?因为我有6个毛坯,它们一次又一次地向下滑动,我只想滑动新的毛坯@阿塞蒂克 on the server page (php) that receive the f

Javascript 我没有按任何键,我现在就挂了,我已经纠正了错误,你能帮我只滑动新插入的原始数据而不是整个列表吗?因为我有6个毛坯,它们一次又一次地向下滑动,我只想滑动新的毛坯@阿塞蒂克 on the server page (php) that receive the f,javascript,php,jquery,ajax,wordpress,Javascript,Php,Jquery,Ajax,Wordpress,我没有按任何键,我现在就挂了,我已经纠正了错误,你能帮我只滑动新插入的原始数据而不是整个列表吗?因为我有6个毛坯,它们一次又一次地向下滑动,我只想滑动新的毛坯@阿塞蒂克 on the server page (php) that receive the facebook notice, you have to put an extra check so if( facebook_data_come ) { // 1 - insert the new data inside your


我没有按任何键,我现在就挂了,我已经纠正了错误,你能帮我只滑动新插入的原始数据而不是整个列表吗?因为我有6个毛坯,它们一次又一次地向下滑动,我只想滑动新的毛坯@阿塞蒂克
on the server page (php) that receive the facebook notice, you have to put an extra check so

if( facebook_data_come ) { 

   // 1 - insert the new data inside your table

   // 2 - on a separate database table that you will call for example facebook_notification_check where you have an INT of 0 or 1 (default to 0), update it to 1 after the first step above.

   // 3 - on the ajax php page you will first check if  facebook_notification_check is equal to 1, if so you will continue with your code and reset the facebook_notification_check back to 0 otherwise you return an empty string...

}
<?php
global $wpdb;
$html = 'unknown error';
$query = "SELECT * FROM $_IL_TABLE_NAME_INTERNAL ORDER BY il_id DESC LIMIT $_IL_START, $_IL_LIMIT";
if($_IL_QUERY_INTERNAL = $wpdb->get_results($query)){
    if(count($_IL_QUERY_INTERNAL)){
        foreach($_IL_QUERY_INTERNAL as $_IL_RESULT_DATA)
        {
            $html = '<li>'. $_IL_RESULT_DATA->il_name . $_IL_RESULT_DATA->il_email . $_IL_RESULT_DATA->il_date .'</li>';
        }
    } else {
        $html = '';
    }
} else {
    header("HTTP/1.0 500 Internal server error");
    $html = mysql_error() . " | sql query : " . $query;
}
echo $html;
?>
<ul id="list"></ul>

<script type="text/javascript" >
    fetch();
    function fetch(){
        jQuery.ajax({
            cache: false,
            url: '/ajax.php',
            success: function(data) {
                console.log(data);
                if(data!=''){

                    jQuery(data).prependTo("#list");
                    jQuery('#list li:first-child').slideDown("slow");

                    setTimeout("fetch()", 100);
                }
            }, 
            error: function(jqXHR, textStatus, errorThrown){
                console.log(jqXHR);
            }
        });
    }
</script>