示例#1
0
<?php

$contacts = Viewer::getModel();
?>
<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
    <script src="../../js/bootstrap.min.js"></script>
    <script src="../../js/bootstrap-table.js"></script>

    <link href="../../css/bootstrap.min.css" rel="stylesheet">
    <link href="../../css/bootstrap-table.css" rel="stylesheet">
    <link rel="shortcut icon" href="/favicon.ico">
    <title>long polling</title>
    <script>
        function getContent(timestamp){
            $('#table').bootstrapTable('refresh',{
                url: '/contacts/?act=ajax&timestamp=' + timestamp

            }).on('load-success.bs.table', function (e, addressbook) {
                getContent(addressbook.timestamp);
            });
        }
        $(function() {
            getContent();
        });
    </script>
</head>