<i id='0MREV'><tr id='0MREV'><dt id='0MREV'><q id='0MREV'><span id='0MREV'><b id='0MREV'><form id='0MREV'><ins id='0MREV'></ins><ul id='0MREV'></ul><sub id='0MREV'></sub></form><legend id='0MREV'></legend><bdo id='0MREV'><pre id='0MREV'><center id='0MREV'></center></pre></bdo></b><th id='0MREV'></th></span></q></dt></tr></i><div id='0MREV'><tfoot id='0MREV'></tfoot><dl id='0MREV'><fieldset id='0MREV'></fieldset></dl></div>
  1. <small id='0MREV'></small><noframes id='0MREV'>

  2. <tfoot id='0MREV'></tfoot>

      <bdo id='0MREV'></bdo><ul id='0MREV'></ul>
  3. <legend id='0MREV'><style id='0MREV'><dir id='0MREV'><q id='0MREV'></q></dir></style></legend>
    1. jQuery 插件实时更新 &lt;li&gt;来自 PHP

      jQuery Plugin to update live a lt;ligt; from PHP(jQuery 插件实时更新 lt;ligt;来自 PHP)

      <legend id='44hZb'><style id='44hZb'><dir id='44hZb'><q id='44hZb'></q></dir></style></legend>

        <bdo id='44hZb'></bdo><ul id='44hZb'></ul>
        • <tfoot id='44hZb'></tfoot>
        • <i id='44hZb'><tr id='44hZb'><dt id='44hZb'><q id='44hZb'><span id='44hZb'><b id='44hZb'><form id='44hZb'><ins id='44hZb'></ins><ul id='44hZb'></ul><sub id='44hZb'></sub></form><legend id='44hZb'></legend><bdo id='44hZb'><pre id='44hZb'><center id='44hZb'></center></pre></bdo></b><th id='44hZb'></th></span></q></dt></tr></i><div id='44hZb'><tfoot id='44hZb'></tfoot><dl id='44hZb'><fieldset id='44hZb'></fieldset></dl></div>

                <small id='44hZb'></small><noframes id='44hZb'>

                  <tbody id='44hZb'></tbody>
                本文介绍了jQuery 插件实时更新 &lt;li&gt;来自 PHP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                是否有任何 jQuery 插件可以使用 PHP 创建类似于 Twitter 主页 的实时提要,哪个是从 MySQL 数据库中获取数据的?
                PHP文件怎么得?
                谢谢.

                is there any jQuery plugin to create something like the live feed from the Twitter Main Page , using PHP, which is getting the data from a MySQL database?
                How has to be the PHP file?
                Thanks.

                推荐答案

                你真的不需要插件,你可以使用 jQuery 轻松创建类似的东西来对 PHP MySQL 提要进行 AJAX 调用

                You really don't need a plugin for this, you could easily create something similar yourself using jQuery to make AJAX calls to a PHP MySQL feed

                使用 setTimeout() 创建一个脚本以进行重复发生的 AJAX 调用,然后添加使用 .prepend()

                Create a script to make reoccurring AJAX calls using setTimeout() and then add the new found results to the feed container using .prepend()

                HTML

                <html>
                <head><title>Tweets</title>
                
                <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
                
                <style>
                #tweets {
                    width: 500px;
                    font-family: Helvetica, Arial, sans-serif;
                }
                #tweets li {
                    background-color: #E5EECC;
                    margin: 2px;
                    list-style-type: none;
                }
                .author {
                    font-weight: bold
                }
                .date {
                    font-size: 10px;
                }
                </style>
                
                <script>
                jQuery(document).ready(function() {
                    setInterval("showNewTweets()", 1000);
                });
                
                function showNewTweets() {
                    $.getJSON("feed.php", null, function(data) {
                        if (data != null) {
                            $("#tweets").prepend($("<li><span class="author">" + data.author + "</span> " +  data.tweet + "<br /><span class="date">" + data.date + "</span></li>").fadeIn("slow"));
                        }
                    });
                }
                </script>
                
                </head>
                <body>
                
                <ul id="tweets"></ul>
                
                </body>
                </html>
                

                PHP

                <?php
                echo json_encode(array( "author" => "someone",
                                        "tweet" => "The time is: " . time(), 
                                        "date" => date('l jS of F Y h:i:s A')));
                ?>
                

                这篇关于jQuery 插件实时更新 &lt;li&gt;来自 PHP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)
                <tfoot id='281l6'></tfoot>
              1. <legend id='281l6'><style id='281l6'><dir id='281l6'><q id='281l6'></q></dir></style></legend>

                      • <i id='281l6'><tr id='281l6'><dt id='281l6'><q id='281l6'><span id='281l6'><b id='281l6'><form id='281l6'><ins id='281l6'></ins><ul id='281l6'></ul><sub id='281l6'></sub></form><legend id='281l6'></legend><bdo id='281l6'><pre id='281l6'><center id='281l6'></center></pre></bdo></b><th id='281l6'></th></span></q></dt></tr></i><div id='281l6'><tfoot id='281l6'></tfoot><dl id='281l6'><fieldset id='281l6'></fieldset></dl></div>
                          <tbody id='281l6'></tbody>

                      • <small id='281l6'></small><noframes id='281l6'>

                          <bdo id='281l6'></bdo><ul id='281l6'></ul>