Chat Smartlet


This Smartlet demonstrates a simple chat server using nothing more than a bit of SXML and jQuery/Scf scripting.

Developed by Marc van Neerven

Rate this Smartlet
You are not allowed to rate this page.
Comments
Marc van Neerven - Saturday, November 07, 2009 11:10 AM

The script used to scroll new chat lines into view has a small drawback in long html pages: it uses the DOM scrollIntoView() method. This method will however scroll the entire page, not only the chat DIV.

Update the script code and change the 2 lines having 'scrollIntoView' to the single line:

div.animate({scrollTop: div[0].scrollHeight},500);

This will fix the problem and make the chatbox even cooler to look at.

Edited by Marc van Neerven on 11/7/2009 12:05:57 PM
Cleaner code...
Ruben Verschueren - Tuesday, February 08, 2011 9:47 AM

Is this a single session chat room? By that I mean does every visitor join the same session or can you make seperate sessions for some visitors?

Edited by Ruben Verschueren on 2/8/2011 9:47:37 AM
spelling mistakes
Marc van Neerven - Sunday, February 13, 2011 11:22 AM

No, each Smartlet instance has its own session, based on the Smartlet id, so you can in fact start as many chat rooms as you like.

Edited by Marc van Neerven on 2/13/2011 11:52:09 AM
Addtion
You are not allowed to post here.

Stay in Touch
Profile
Latest additions
Workbench beta has expired
Hank Brandwijk, 11 January 2012, 16:53
Smartsite iXperion 1.4 build 4 has been released! locked
Twan Meijerink, 02 December 2011, 11:04
The second life of XForms
Marc van Neerven, 04 November 2011, 18:34
How to hide a property in a custom module? locked
Peter van der Waal, 17 October 2011, 09:31
Content, content, content...Waar halen we het vandaan?!
Ad van der Kolk, 07 October 2011, 17:48
Microsoft Certified Partner Logo