M
Martin
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_NUMBERS'
codebase='/mywinsock.dll'></object>
<script language=vbscript>
<!--
Sub Window_OnLoad
Winsock1.CloseConnection
Winsock1.RemoteHost = Window.Location.Hostname
Winsock1.RemotePort = 1234
Winsock1.LocalPort = 0
Winsock1.Connect
End Sub
Sub Window_OnUnload
Winsock1.CloseConnection
End Sub
Sub Winsock1_DataArrival(bytesTotal)
Dim Msg
Winsock1.Getdata Msg, vbString
alert(Msg)
End Sub
-->
</script>
</body>
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_NUMBERS'
codebase='/mywinsock.dll'></object>
<script language=vbscript>
<!--
Sub Window_OnLoad
Winsock1.CloseConnection
Winsock1.RemoteHost = Window.Location.Hostname
Winsock1.RemotePort = 1234
Winsock1.LocalPort = 0
Winsock1.Connect
End Sub
Sub Window_OnUnload
Winsock1.CloseConnection
End Sub
Sub Winsock1_DataArrival(bytesTotal)
Dim Msg
Winsock1.Getdata Msg, vbString
alert(Msg)
End Sub
-->
</script>
</body>