2013-02-12 162 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

相關問題