
Microsoft® Chat 1.0j is a Java applet that provides the Web designer with a simple, customizable user interface and programmability for the applet. With this applet, the page can be coded to join or create an existing room on the chat server with a nickname selected by the user. Other options include the ability to customize or hide the toolbar, and hide the member list and/or input field. The applet provides the Web designer with a default user interface that includes dialog boxes to view the room list, create and join a room, change the nickname, change fonts, and connect to the server. The default user interface is customizable by the Web designer.
Microsoft Chat 1.0j does not provide event notification and does not display the user list on the chat server.
Setting Up Microsoft Chat 1.0j
The following steps show how to set up Microsoft Chat 1.0j to work with your chat server:
The following is a list of optional parameters that can be applied to a Chat applet embedded on a Web page by using the <PARAM> tag.
| Name | Value(s) | Default | Description |
| port | [number] | 6667 | Specifies the port on which the chat server is running, usually 6667. |
| nickname | [user nickname] | "Anonymous" | Specifies the default name, used for autoconnect. |
| room | [roomname] | - | Specifies the default room to join. |
| toolbar | true | false | true | Determines if the toolbar should be visible. |
| memberlist | true | false | true | Determines if the member list should be visible. |
| observer | true | false | false | Determines if the user can participate in a conversation. |
| banner | [imagename] | - | Specifies a welcome image that should be displayed when the applet loads. |
| autoconnect | true | false | false | Determines if the applet will automatically connect when loaded. If true, room and nickname must be specified. |
| autodisconnect | true | false | false | Determines if the applet will automatically disconnect when the page is exited. |
| motd | true | false | true | Determines if the applet will display the Message of the Day after connecting. |
| stats | true | false | true | Determines if the applet will display server statistics after connecting. |
| id | [unique string] | "null" | Indicates that unique identifiers must be supplied if multiple chat applets will be on the same page. |
| font | fontname, style, size | Helvetica, 0, 11 | Helvetica | Dialog | TimesRoman | Courier, 0(plain), 1(bold), 2(italic), 3(bold + italic), 8 - 20 |
| bgcolor | ffffff | c0c0c0 | Specifies the color, using hexadecimal notation same as in the HTML body tag. |
Example
HTML code for embedding an applet in a page. This sample shows the main user interface for Chat 1.0j. The user can use the toolbar to choose a nickname, connect to the chat server and join or create a chat room to chat in.
<applet code=MSChat archive=mschat.jar name=Chat width=500 height=400>
<param name=cabbase value=mschat.cab>
<param name=room value=#newbies>
<param name=port value=6667>
</applet>
The following methods are exposed by the Chat applet. They can be called from any script language supported by the client browser.
| Method | Returns | Description |
| connect(string nickname) | void | Connects to the server with the specified nickname. |
| connect(string nickname, string room) | void | Connects to the server with the specified nickname and joins the specified room, overriding any present room parameter. |
| disconnect() | void | User leaves all rooms and closes the connection with the server. |
| getNick() | String | Returns the user nickname, or null if the user hasn't yet logged on. |
| getRoom() | String | Returns the name of the room the user is currently in, or null if the user hasn't yet logged on. |
| join(string room, string password) | void | Leaves any current room, joins a specified room. Password is ignored if null or "". |
| showRoomList() | void | Displays the room list window. |
| showEnterRoomDialog() | void | Displays the dialog box that prompts user to enter a chat room. |
| showFontDialog() | void | Displays the dialog box that prompts user to change the current font. |
| showConnectDialog() | void | Displays the dialog box that prompts user to connect to a server. |
| showAboutDialog() | void | Displays the Microsoft Chat dialog box. |
Example
The following example calls the connect method.
<FORM NAME="form1">
<INPUT TYPE="button" VALUE="Connect" onClick="document.Chat.connect(document.form1.nickname.value, document.form1.room.value)">
</FORM>
<applet code=MSChat archive=mschat.jar
name=Chat width=500 height=400>
<param name=cabbase value=mschat.cab>
<param name=room value=#newbies>
<param name=port value=6667>
</applet>
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.