refresh page without click sound

J

JJ

Hi,
I am writing a web chat facility in asp.
The problem is that my chat screen has to refresh every 10 seconds to check
for any new messages in the conversation, this causes a 'click' sound.
How can you refresh a page with out a 'click' sound? I currently use the
meta refresh method, but there must be a different way, as other html chat
clients I have seen do not make the 'click' sound and do not appear to use
the meta refresh method.
Thanks
JJ
 
D

dlbjr

Use JavaScript and XML HTTP to make a call back to the server and receive the newest data then just
append the new data to the bottom of the text in the screen. Why refresh the whole page every time?

'from dlbjr

'Unambit from meager knowledge of inane others,engender uncharted sagacity.
 
D

dlbjr

<script language="javascript" >
//Set how often to update
var intsecods = 1;
//Set the url to get data from
var url = "http://www.mamma.com"

var x=setInterval("update()",1000 * intsecods)

function update() {
var http = new ActiveXObject("Microsoft.XMLHTTP");
try{
http.Open("GET",url,false);
http.send();
if(http.readyState==4) {
data1.innerHTML = http.ResponseText
}
}
catch(e){
if(e instanceof Error) {
data1.innerHTML = "no connection";
}
}
}
</script>
<html>
<head>
<title></title>
</head>
<body>
<div id="data1">
</div>
</body>
</html>


//from dlbjr

//Unambit from meager knowledge of inane others,engender uncharted sagacity.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,190
Members
46,736
Latest member
zacharyharris

Latest Threads

Top