Shown below is the body of a web page I'm developing. When it loads, a
socket connection is established back to a socket that's on my server.
I can then send a message from the server and it will show up on this
page. This works as intended (IE only, of course).
I'm going to add some functionality to this script and I want to do it
in javascript - I'd like to do this part in javascript also.
Can someone tell me what I need to do to translate this?
Thanks.
<body>
<object id='Winsock1' classid='clsid:---A_BUNCH_OF_NUMB ERS'
codebase='/mywinsock.dll'> </object>
<script language=vbscri pt>
<!--
Sub Window_OnLoad
Winsock1.CloseC onnection
Winsock1.Remote Host = Window.Location .Hostname
Winsock1.Remote Port = 1234
Winsock1.LocalP ort = 0
Winsock1.Connec t
End Sub
Sub Window_OnUnload
Winsock1.CloseC onnection
End Sub
Sub Winsock1_DataAr rival(bytesTota l)
Dim Msg
Winsock1.Getdat a Msg, vbString
alert(Msg)
End Sub
-->
</script>
</body>
Comment