I want to code a realtime chatroom for my page. I don't want to install or download any components from other providers. Is this possible with ASP or do i need to use java maybe?
This can be done with a little client side javascript,asp
and a database.
The first point is what is real-time. With some applications, java ones typicaly, this can be very
close to instantaneous, but the real point is is a
one or two second delay reasonable.
Use this page to get the top 50 records from the
database in datetime order.
loop through these records and create your html output.
Make sure the output is within <div id="getChat">
and </div>
at the bottom of the page use
<script language="javascript">
parent.Chat.innerHTML = document.all.getChat.innerHTML;
window.setTimeout("history.go(0);",1000);
</script>
Page THREE :
Process the insert of the message into the database.
The speed of this method =
the time it takes your server to process the insert
+
the time it takes to generate the output
+
the time of the refresh of frame 1(Page TWO)
+
the time it takes for the client to process the javascript
IF you want me to write a more code specific answer
just reply here.
Hope this helps.
One of the best things to come from IE5.5 is the XML support - enabling server connection without full page refresh - so you can send and receive messages more efficiently.
i'm not familiar with java script. Is there a way I can do it with ASP? I would just have a multi-line text box then POST the text to the same page (is that even possible? and if so how would i retrieve the information) then just update the page?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.