Javascript Nginx-admin-ajax.php-ajax结果返回问题-wordpress导致未捕获的语法错误:意外标记

Javascript Nginx-admin-ajax.php-ajax结果返回问题-wordpress导致未捕获的语法错误:意外标记,javascript,php,ajax,wordpress,nginx,Javascript,Php,Ajax,Wordpress,Nginx,问题是它在我的Apache上运行正常。Nginx返回错误消息,错误为 未捕获的语法错误:意外标记

问题是它在我的Apache上运行正常。Nginx返回错误消息,错误为 未捕获的语法错误:意外标记<

这是我在Functions.php中的函数

函数搜索范围{ 全球$wpdb

 if (strlen($_POST['s'])>0) {
    $postid = $_POST['s'];

    $args = array(
        'numberposts' => 5,
        'post_type' => array ( 'mail'),
        's' => $postid
    );

    // get results

    $the_query = new WP_Query( $args );
    $array = array();
    $i = 0;
    if( $the_query->have_posts() ):
    while ( $the_query->have_posts() ) : $the_query->the_post();

                $array[$i] = array();
                $array[$i]['title'] = get_the_title();
                $array[$i]['permalink'] = get_permalink();



                   $trendingrows = get_field('mail_name') ?: get_field('mail_colo') ?: get_field('mail_lamo') ?: get_field('mail_rug') ?: get_field('mail_ti') ?: get_field('mail_timb') ?: get_field('mail_vin');

                                if($trendingrows)
                                {
                                    $ti =1;
                                         foreach($trendingrows as $rowinttv) {
                                            if ($ti==1)
                                             {
Fetch All the Data Function
                                             }

                                        }
                                }

                $array[$i]['mailtype']= get_field('carp_mail_type');


                $i++;

   endwhile;
    echo json_encode($array); 
   endif;

}
else echo '';
die();
我的Scripts.js如下所示

  $( "#rangesearch" ).autocomplete({
            minLength: 3,
        source: function(request, response) {
            $.ajax({
                url: "/wp-admin/admin-ajax.php",
                data: 'action=fm_searchranges&s=' + $("#rangesearch").val(),
                dataType: "json",
                type: "POST",
                success: function(data) {
                                        $("#search_by_results").html("");
                                        $("#search_by_results").show();

                                        for (var i = 0; i < data.length; i++) {
                                            console.log(data[i]['fibretype']);
                                            $("#search_by_results").append('<div class="sbr_row"><img src="/images'+ data[i]['image'].replace('"', '') +'" alt="" /><h2>'+ data[i]['title'] +'</h2><h3>'+ data[i]['type'] +'</h3><a href="'+ data[i]['permalink'] +'">View Mail</a></div><!--.row-->');
}
                        }

    });
}
}).data( "autocomplete" )._renderItem = function( ul, item ) {
    return $("<li></li>")
        .data("item.autocomplete", item)
        .append("<a>" + item.label + "<br>" + item.description + "</a>")
        .appendTo(ul);
};
})

我们在代码中插入了autocomplete.min.js,这导致了问题/冲突,admin-ajax.php后期操作无法访问

关闭了automcomplete,现在似乎可以工作了