前端展示php代码;
<"Content-type: text/html; charset=utf-8"); include_once("./config.php"); // 初始显示界面数据获取 $data = file_get_contents(URL."/interfaces/page.php"); // echo $data;die; $data = json_decode($data); // var_dump($data);die; "zh-cn"> <head> <meta name="viewport" content="initial-scale=1, user-scalable=0, minimal-ui" charset="UTF-8"> <title>加载顶部、底部</title> <!-- 页面布局 --> <link rel="stylesheet" type="text/css" href="./css/display.css" rel="external nofollow" > <!-- 框架布局 --> <link rel="stylesheet" href="./css/dropload.css" rel="external nofollow" > </head> <body> <div class="header"> <h1>就当我是新闻页吧</h1> </div> <div class="content"> <div class="lists"> <!-- lists在外 避免造成多次循环输出 --> <"item" href="#" rel="external nofollow" > <img src="/UploadFiles/2021-04-02/pic.jpg"><"Content-type: text/html; charset=utf-8"); // 包含数据库配置信息 include_once('../config.php'); // 接收数据 $paging = isset($_REQUEST['paging'])"连接失败 : ".$conn->connect_error); } // echo "链接成功"; // 设置字符集(以防出错 每次都要写) $conn->query("SET NAMES utf8"); // 2 . 数据操作 $sql = "SELECT * FROM mission_news order by id desc limit $start_page , $num;"; // $sql = "SELECT * FROM mission_news order by id desc limit 0 , 15;"; // 3 . 执行一条语句 $ret = $conn->query($sql); // 4 . 循环获取每条记录 if ($ret->num_rows > 0) { while ($row = $ret->fetch_assoc()) { //将每条记录以 数组形式 返回 // var_dump($row); // echo "id = ".$row['id']." mid = ".$row['mid']." context = ".$row['context']."<br>"; $tmp = array();//临时数组整合信息 $tmp['id'] = $row['id']; $tmp['mid'] = $row['mid']; $tmp['context'] = $row['context']; $tmp['turn'] = $row['turn']; $tmp['created'] = $row['created']; // 临时数组 拼接到 返回的数组中 $data[] = $tmp; // 自增 } // 拼接返回数组 $return['result'] = 1; $return['data'] = $data; } // 5 . 关闭数据库 $conn->close(); // 6 . 编码为json字符串返回 echo json_encode($return); ?>以上所述是小编给大家介绍的JS 插件dropload下拉刷新、上拉加载使用小结,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对网站的支持!