Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Make a chatroom?

Status
Not open for further replies.

SSJpn

Technical User
Oct 7, 2002
259
US
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.

If so here it is.

Page ONE:

<div id=&quot;Chat&quot;></div>
<iframe src=&quot;PageTWO&quot;></iframe>
<iframe src=&quot;about:blank&quot;></iframe>
<form action=&quot;Page3&quot; target=&quot;iframe2&quot;>
<input type=&quot;text&quot;><input type=&quot;submit&quot;>
</form>

That was simple.

Page TWO:

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=&quot;getChat&quot;>
and </div>
at the bottom of the page use
<script language=&quot;javascript&quot;>
parent.Chat.innerHTML = document.all.getChat.innerHTML;
window.setTimeout(&quot;history.go(0);&quot;,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.

CFK
 
Hello

This is possible using ASP.

The book Active Server Pages 2.0 Unleashed has the sample code.

ISBN 0-672-31613-7

It works too.
 
ActiveX,
are you familiar with it? Are you able to supply a small sample code? -Ovatvvon :-Q
 
cfk,

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?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top