Jump to content

Recommended Posts

Hi All,

 

I am new here and looking for a little bit of help on a project I have been working on. At the moment we have data streaming in to a SQL database.

 

Each new set of data is put in to a separate row in the table which we then require to display in a chat window. We can get the chat to show and we are polling the database every 3000 milliseconds for data to show.

 

However when the refresh takes place the whole div id refreshes causing the chat to appear to be flashing - even when there is no new data to display.

 

This is a simplified version of the code we are using:

<html> 
<head> 
	<style type="text/css"> 
		#load_msg
			{
				background-color:#ffffcc;
				font-size:24px;
				font-family:'Georgia', Times New Roman, Times, serif;
				font-weight:bold; 
			}
	</style> 

	<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.0/jquery.min.js"></script> 

	<script> 
		var auto_refresh = setInterval(
		function()
			{
				$('#load_msg').fadeOut('slow').load('update.php').fadeIn("slow");
				}, 3000); //3000 Milliseconds or 3 seconds
	</script> 
</head> 

<body> 
	<div id="load_msg"> 
	</div> 
</body>
</html>

 

Any suggestions on how to solve this would be hugely appreciated.

Link to comment
https://forums.phpfreaks.com/topic/215642-ajax-auto-refresh-for-chat/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.