Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/298.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 自动加载分页不起作用。已通过htaccess清除URL_Php_.htaccess_Pagination - Fatal编程技术网

Php 自动加载分页不起作用。已通过htaccess清除URL

Php 自动加载分页不起作用。已通过htaccess清除URL,php,.htaccess,pagination,Php,.htaccess,Pagination,我在我的页面上使用自动加载分页方法,但当使用htaccess清理url时,分页停止工作,甚至数据也不会显示。如果我删除分页方法,一切正常,或者如果我删除htaccess,一切正常 <script src="js/jquery-1.11.1.min.js"></script> <script type="text/javascript"> var busy = false; var limit = 10 var offset = 0;

我在我的页面上使用自动加载分页方法,但当使用htaccess清理url时,分页停止工作,甚至数据也不会显示。如果我删除分页方法,一切正常,或者如果我删除htaccess,一切正常

    <script src="js/jquery-1.11.1.min.js"></script>
<script type="text/javascript">
  var busy = false;
  var limit = 10
  var offset = 0;

  function displayRecords(lim, off) {  
    $.ajax({
      type: "GET",
      async: false,


        url: "getresult.php", 
       data: "limit=" + lim + "&offset=" + off + "&city=<?php echo $_GET['city'] ; ?>",



      cache: false,

      success: function(html) {
        $("#results").append(html);
        window.busy = false;
      }
    });
  }

  $(document).ready(function() {
    // start to load the first set of data
    if (busy == false) {
      busy = true;
      // start to load the first set of data
      displayRecords(limit, offset);
    }


    $(window).scroll(function() {
      // make sure u give the container id of the data to be loaded in.
      if ($(window).scrollTop() + $(window).height() > $("#results").height() && !busy) {
        busy = true;
        offset = limit + offset;

        // this is optional just to delay the loading of data
        setTimeout(function() { displayRecords(limit, offset); }, 500);

        // you can remove the above code and can use directly this function
        // displayRecords(limit, offset);

      }
    });

  });

</script>

你将使用什么url?主页url是eventlist.php,在这里我们需要按城市过滤数据,所以完整的url是eventlist.php?city=过滤后的数据通过ajax出现在这个页面上,ajax url是url:“getresult.php”,数据:“limit=“+lim+”&offset=“+off+”&city=”您好,如果没有人回复,在stackoverflow上寻求帮助的乐趣是什么。它应该是关闭的,您要访问哪个url?主页url是eventlist.php,在这里我们需要按城市过滤数据,因此完整的url是eventlist.php?city=过滤后的数据通过ajax出现在这个页面上,ajax url是url:“getresult.php”,数据:“limit=“+lim+”&offset=“+off+”&city=“您好,如果没有人回复,在stackoverflow上寻求帮助有什么乐趣。应该关闭它
    RewriteRule ^city/([a-zA-Z0-9_-]+)/?$ eventlist.php?city=$1