jQuery的ajax請求新增 載入中 提示

2021-07-22 17:38:45 字數 888 閱讀 5566

主要實現功能:

1、下拉載入資料時顯示 「載入中…」​

2、每次載入完後顯示 「載入更多」​

3、當所有資料載入完後

頁面顯示

class="video_list" id="video_big">

class="video_list" id="video_list">

@if($ovideos) @foreach($ovideos

as $k=>$v)

class="one_list" id="one_list">

href="/video/video-info/}">

list_img">

@if(trim($v->img_thumb))

@else

@endif

button" class="btn" />

list_info">

}案例分享:@if($v->author) } @else 暫無 @endif

點讚數目:@if($v->like_count) } @else 0 @endif

@endforeach

@endif

loading_box" id="loading_box">

pop_cover">

知識簡介:

1、​ajaxstart() 在ajax請求開始時執行函式,所有的ajax提交都會觸發ajaxstart事件

$("#loading").ajaxstart(function

());2、ajaxstop() 在ajax請求結束時執行函式

$("#loading").ajaxstop(function

());

jQuery中的ajax請求

全域性配置 1.ajaxsetup方法可以設定全域性配置 1 全域性配置會作為下次ajax方法的預設引數 2 全域性配置可以被ajax方法的配置覆蓋 3 全域性配置適用於所有基於ajax方法的衍生方法 例如 全域性配置 ajaxsetup ajax請求函式 function ajax 2.全域性 1...

jquery版本的ajax請求

首先引入 script 和 jqurey是乙個函式,呼叫函式會返回乙個物件 jquery封裝的ajax get請求 函式中有get屬性 加 呼叫 get 張三 password 123 function date,state,xhr get function date post date conso...

jQuery傳送Ajax請求

ajax cache false,async true,type post datatype json xml html success function result ajax cache false,async false,type post datatype json xml html suc...