Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/276.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/88.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和jquery中使用ajax在同一页面上滚动从数据库加载_Php_Jquery_Html_Ajax - Fatal编程技术网

如何在php和jquery中使用ajax在同一页面上滚动从数据库加载

如何在php和jquery中使用ajax在同一页面上滚动从数据库加载,php,jquery,html,ajax,Php,Jquery,Html,Ajax,我需要一些帮助,关于我的电子商务网站正在开发,我想加载从数据库在页面滚动车的问题是,我想退出我的“过滤类别第一”,然后显示在数据库中的购物车项目下面是我的脚本 <span class="applied-amount">Applied Filters</span> <button type="button" class="btn btn-default btn-sm clear-all pull-right" id="clear-all">CLEAR ALL&l

我需要一些帮助,关于我的电子商务网站正在开发,我想加载从数据库在页面滚动车的问题是,我想退出我的“过滤类别第一”,然后显示在数据库中的购物车项目下面是我的脚本

<span class="applied-amount">Applied Filters</span>
<button type="button" class="btn btn-default btn-sm clear-all pull-right" id="clear-all">CLEAR ALL</button>
</div>
<div class="column-filters panel-group" id="accordion">
<div class="panel-title-bcrums"> </div>
<!--Category Panel-->
<div class="panel panel-default">
    <div class="panel-heading">
        <div class="panel-title"> CATEGORY </div>
    </div>
    <div id="collapseOne" class="panel-collapse collapse in">
        <label name="filter-category" data-category-url="computer-software" data-category-id=""> <span class="filter-key">Computer Software</span> <span class="filter-count">(724)</span> <i class="fa fa-angle-right pull-right caret-icon" name="filter-category" data-category-url="computer-software"></i> </label>
        <label name="filter-category" data-category-url="accessories-computing" data-category-id=""> <span class="filter-key">Computing Accessories</span> <span class="filter-count">(8764)</span> <i class="fa fa-angle-right pull-right caret-icon" name="filter-category" data-category-url="accessories-computing"></i> </label>
        <label name="filter-category" data-category-url="computing-bundles" data-category-id=""> <span class="filter-key">Computing Bundles</span> <span class="filter-count">(3)</span> <i class="fa fa-angle-right pull-right caret-icon" name="filter-category" data-category-url="computing-bundles"></i> </label>
        <label name="filter-category" data-category-url="desktop-monitors" data-category-id=""> <span class="filter-key">Desktop and Monitors</span> <span class="filter-count">(493)</span> <i class="fa fa-angle-right pull-right caret-icon" name="filter-category" data-category-url="desktop-monitors"></i> </label>
        <label name="filter-category" data-category-url="laptops" data-category-id=""> <span class="filter-key">Laptops</span> <span class="filter-count">(2309)</span> <i class="fa fa-angle-right pull-right caret-icon" name="filter-category" data-category-url="laptops"></i> </label>
        <label name="filter-category" data-category-url="networking" data-category-id=""> <span class="filter-key">Networking</span> <span class="filter-count">(1628)</span> <i class="fa fa-angle-right pull-right caret-icon" name="filter-category" data-category-url="networking"></i> </label>
        <label name="filter-category" data-category-url="printers-scanners-5232" data-category-id=""> <span class="filter-key">Printers, Scanners and Accessories</span> <span class="filter-count">(3550)</span> <i class="fa fa-angle-right pull-right caret-icon" name="filter-category" data-category-url="printers-scanners-5232"></i> </label>
        <label name="filter-category" data-category-url="projectors-5233" data-category-id=""> <span class="filter-key">Projectors &amp; Accessories</span> <span class="filter-count">(582)</span> <i class="fa fa-angle-right pull-right caret-icon" name="filter-category" data-category-url="projectors-5233"></i> </label>
    </div>
    <div class="clearfix"></div>
</div>
Brand Panel
<div class="panel panel-default ">
<div class="for-brand"></div>
<div class="panel-heading">
    <div class="panel-title" data-toggle="collapse" data-target="#collapseTwo" aria-expanded="true"> BRAND <span class="panel-selected-size -brand">(0)</span> <i class="fa fa-angle-down pull-right caret-icon"></i> <i class="fa fa-angle-up pull-right caret-icon"></i> </div>
</div>
<div id="collapseTwo" class="panel-collapse collapse in">
<input type="text" class="search-brand" id="search-brand-input" placeholder="Search brands..">
<div class="brand-list-remote"></div>
<div id="aggregated_brand" class="brand-list" filter-attr-val="aggregated_brand">
<label data-name="Acer" class="aggregated_brand filter-40660">
    <input class="filter-box" type="checkbox" name="filter-brand"
                                                               data-brand="Acer"  data-count="121"/>
    <span class="filter-key">Acer</span> <span class="filter-count">(121)</span> </label>
<label data-name="Apple" class="aggregated_brand filter-39454">
    <input class="filter-box" type="checkbox" name="filter-brand"
                                                               data-brand="Apple"  data-count="332"/>
    <span class="filter-key">Apple</span> <span class="filter-count">(332)</span> </label>
<label data-name="Asus" class="aggregated_brand filter-150136">
    <input class="filter-box" type="checkbox" name="filter-brand"
                                                               data-brand="Asus"  data-count="104"/>
    <span class="filter-key">Asus</span> <span class="filter-count">(104)</span> </label>
Displaying of carts here from tables
<div class="catalog-box">
    <ul id="myList" class="catalog">
        <?php include('getresult.php'); ?>
    </ul>
</div>
应用的过滤器
清除所有
类别
计算机软件(724)
计算机配件(8764)
计算束(3)
桌面和显示器(493)
笔记本电脑(2309)
联网(1628)
打印机、扫描仪和配件(3550)
投影仪及;配件(582)
品牌面板
品牌(0)
宏碁(121)
苹果(332)
华硕(104)
在此处显示来自表的手推车
您可以使用
$(窗口)。滚动()

$(window).scroll(function (event) {
    yourFunction();
});
function yourFunction(){
   //call your ajax here
}

在ajax中,编写一段代码从数据库中获取数据,成功后加载下一部分html。

Google it,您可以在那里获得多个关于此的博客