对不起我是一个菜鸟我只是想知道我是如何让这个javascript每秒运行一次?
源代码:
<script type="text/javascript">
$(function() {
    //More Button
    $('.more').live("click",function()  {
        var ID = $(this).attr("id");
        if(ID) {
            $("#more"+ID).html('<img src="moreajax.gif" />');
            $.ajax({
                type: "POST",
                url: "ajax_more.php",
                data: "lastmsg="+ ID, 
                cache: false,
                success: function(html){
                    $("ol#updates").prepend(html);
                    $("#more"+ID).remove();
                }
            });
        } else {
            $(".morebox").html('no posts to display');
        }
        return false;
    });
});
</script>
Run Code Online (Sandbox Code Playgroud) 如何通过PHP获取页面内容?我如何获取博客文章的文本,因为大多数RRS提要仅提供文章的链接,所以我不能使用它.是否存在PHP函数或者无论如何都要执行此操作.请提供一些建议:).
我需要在jQuery .html()函数中打印一个var ..我该怎么做?
.html('<table><tr><td><!-- VAR PRINT HERE? --></tr></td>')
Run Code Online (Sandbox Code Playgroud) 我有一个jQuery脚本,每秒使用setinterval运行一个函数.但我想设置一个超时,所以在半小时后它会杀死脚本.我该怎么做呢?谢谢 :)
源代码:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/
libs/jquery/1.3.0/jquery.min.js"></script>
<script type="text/javascript">
$(function() {
    setInterval(oneSecondFunction, 1000);
});
function oneSecondFunction() {
    //var ID = $(this).attr("id");
    var ID = '1';
    if(ID){
        $("#more"+ID).html('<img src="moreajax.gif" />');
        $.ajax({
            type: "POST",
            url: "ajax_more.php",
            data: "lastmsg="+ ID, 
            cache: false,
            success: function(html){
                $("ol#updates").prepend(html);
                $("#more"+ID).remove();
            }
        })
    }
    return false;
}
</script>
<style>
Run Code Online (Sandbox Code Playgroud) 有没有办法让我可以使用数字和字母生成Mysql中的唯一id(主键)以保持id尽可能短?如果我不能在Mysql中这样做,我怎么能让PHP生成这个?谢谢 :)
我的脚本在第五行发出一个意想不到的t字符串我该如何解决这个问题?
<?php
include_once("../scripts/config.php");
$url = mysql_real_escape_string('$_POST['url']'); // LINE 5!
preg_match("/id=(\\d+)/", $url, $matches);
$like = $matches[1];
$current_pop = mysql_query("SELECT pop FROM likes WHERE id=$like") or die ("Query failed: " . mysql_error());
$pop = $current_pop + 1;  
$update = mysql_query("UPDATE likes SET pop = ".$pop." WHERE id = ".$like."") or die ("Query failed: " . mysql_error());
?>
Run Code Online (Sandbox Code Playgroud) 如何在不刷新页面的情况下对PHP脚本进行href链接调用?一般情况下?如果有人能指出我正确的方向,那就太好了.:)