I am trying to read binary data in javascript. I got one BinaryReader.js on net. I copied that file where Default.aspx is. If I write the code like following then project got build and running but handshake is not getting done. If I remove src="BinaryReader.js" then handshake is getting done properly. So my question is, Can I use external script along with my script in same asp.net page? If yes then what am i doing wrong?
<script src="BinaryReader.js" language="javascript" type = "text/javascript">
var ws;
function btnConnectSend_onclick() {
if ("WebSocket" in window) {
ws = new WebSocket("ws://localhost:35000/");
ws.onopen = function() {
alert("Connection Open......");
};
ws.onmessage = function(evt) {
var reader = new BinaryReader(evt.data);
var tag = reader.readString(26);
//var txt = document.createTextNode(evt.data.toString());
form1.txtMessage.appendChild(tag);
};
ws.onclose = function() {
alert("Socket Closed!!!");
};
ws.onerror = function() {
alert("WTF!");
};
}
}
function btnClose_onclick() {
ws.close();
};
</script>