2013-02-12 159 views
-2

我想重装我的文字大约每5秒钟,让我的用户看到他们有新邮件...我的代码如下所示:刷新格或负载文本无需刷新整个页面

If C_Mess "0" Then <span class="message-count"> C_Mess </ span> Else 0 End If 

灿任何人都帮我每5秒钟重新加载一次? Javacript/jQuery或其他。

我想刷新<span class="message-count"> C_Mess </ span>

非常感谢您的答复。

+1

什么服务器端语言,这是? C_Mess?无论哪种方式,读入AJAX。 – Leeish 2013-02-12 20:42:57

+0

C_Mess = Conn.Execute(“Select Count(id)from community_super_mess where toId =”&Cint(Session(“user_id”))&“and reed = 0 and mapp = 0”。字段(0) – 2013-02-12 20:47:04

+0

Ajax?哪里???? – 2013-02-12 20:47:34

回答

0
<html> 
<head> 
<!-- For ease i'm just using a JQuery version hosted by JQuery- you can download any version and link to it locally --> 
<script src="http://code.jquery.com/jquery-latest.js"></script> 

<script> 

    var refreshId = setInterval(function(){ 
     $('#responsecontainer').fadeOut("slow").load('response.php').fadeIn("slow"); 
    }, 5000); 

</script> 
</head> 
<body> 

    <div id="responsecontainer"> 
    </div> 
</body> 
+0

我发现这个代码已经tryid。我不想加载一个网页,我想有加载只是一个代号我的消息越来越装“<% C_Mess %>” – 2013-02-12 21:00:15

+0

我想是这样的: <%If C_Mess >“0”,然后%> Dosent work! :S – 2013-02-12 21:17:07

0

我把下面的一个setTimeout函数中:

$(".message-count").hide().html('the new message count').fadeIn('fast'); 
+0

function(){ $(document#).ready(function(){update();}); function update setTimeout('update()',5000);} })(); - 像这样? – 2013-02-12 21:25:48

相关问题