01.
<!DOCTYPE html>
02.
<html>
03.
<head>
04.
<meta http-equiv=
"Content-Type"
content=
"text/html; charset=utf-8"
/>
05.
<meta name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
06.
<title>รายวัน</title>
07.
<link rel=
"stylesheet"
href=
"css/csspage.css"
>
08.
<script type=
"text/javascript"
src=
"js/jquery-3.3.1.min.js"
></script>
09.
<script type=
"text/javascript"
>
10.
$(document).ready(
function
(){
11.
var
flag = 0;
12.
$.ajax({
13.
type:
"GET"
,
14.
url:
"get_data.php"
,
15.
data:{
16.
'offset'
: 0,
17.
'limit'
: 9
18.
},
19.
success:
function
(data){
20.
$(
'body'
).append(data);
21.
flag += 9;
22.
}
23.
});
24.
$(window).scroll(
function
(){
25.
if
($(window).scrollTop() >= $(document).height() - $(window).height()) {
26.
$.ajax({
27.
type:
"GET"
,
28.
url:
"get_data.php"
,
29.
data:{
30.
'offset'
: flag,
31.
'limit'
: 9
32.
},
33.
success:
function
(data){
34.
$(
'body'
).append(data);
35.
flag += 9;
36.
}
37.
});
38.
}
39.
40.
});
41.
42.
43.
44.
});
45.
</script>
46.
47.
48.
</head>
49.
50.
<body>
51.
</body>
52.
</html>