Created
June 21, 2011 16:53
-
-
Save TheNicholasNick/1038307 to your computer and use it in GitHub Desktop.
IE8 chat app don't work - socket.io 0.7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
info - handshake authorized | |
info - handshaken 4e2b6f6413b1ddd603a4e8843fe7bb97 | |
debug - served static /static/flashsocket/WebSocketMain.swf | |
debug - setting request GET /socket.io/1/flashsocket/4e2b6f6413b1ddd603a4e8843fe7bb97 | |
debug - publishing that 4e2b6f6413b1ddd603a4e8843fe7bb97 connected | |
debug - initializing client store for 4e2b6f6413b1ddd603a4e8843fe7bb97 | |
debug - set heartbeat interval for client 4e2b6f6413b1ddd603a4e8843fe7bb97 | |
debug - subscribing 4e2b6f6413b1ddd603a4e8843fe7bb97 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Webpage error details | |
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; WOW64; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.0.30729; .NET CLR 3.5.30729) | |
Timestamp: Tue, 21 Jun 2011 16:51:35 UTC | |
Message: Object expected | |
Line: 38 | |
Char: 1 | |
Code: 0 | |
URI: http://gentoo:3000/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html><html><head><link href="/stylesheets/style.css" rel="stylesheet"><script src="http://code.jquery.com/jquery-1.6.1.min.js"></script><script src="/socket.io/socket.io.js"></script><script>// socket.io specific code | |
var socket = io.connect(); | |
socket.on('connect', function () { | |
$('#chat').addClass('connected'); | |
}); | |
socket.on('announcement', function (msg) { | |
$('#lines').append($('<p>').append($('<em>').text(msg))); | |
}); | |
socket.on('nicknames', function (nicknames) { | |
$('#nicknames').empty().append($('<span>Online: </span>')); | |
for (var i in nicknames) { | |
$('#nicknames').append($('<b>').text(nicknames[i])); | |
} | |
}); | |
socket.on('user message', message); | |
socket.on('reconnect', function () { | |
$('#lines').remove(); | |
message('System', 'Reconnected to the server'); | |
}); | |
socket.on('reconnecting', function () { | |
message('System', 'Attempting to re-connect to the server'); | |
}); | |
socket.on('error', function (e) { | |
message('System', e ? e : 'A unknown error occurred'); | |
}); | |
function message (from, msg) { | |
$('#lines').append($('<p>').append($('<b>').text(from), msg)); | |
} | |
// dom manipulation | |
$(function () { | |
$('#set-nickname').submit(function (ev) { | |
socket.emit('nickname', $('#nick').val(), function (set) { | |
if (!set) { | |
clear(); | |
return $('#chat').addClass('nickname-set'); | |
} | |
$('#nickname-err').css('visibility', 'visible'); | |
}); | |
return false; | |
}); | |
$('#send-message').submit(function () { | |
message('me', $('#message').val()); | |
socket.emit('user message', $('#message').val()); | |
clear(); | |
$('#lines').get(0).scrollTop = 10000000; | |
return false; | |
}); | |
function clear () { | |
$('#message').val('').focus(); | |
}; | |
}); | |
</script></head><body><div id="chat"><div id="nickname"><form id="set-nickname" class="wrap"><p>Please type in your nickname and press enter.</p><input id="nick"><p id="nickname-err">Nickname already in use</p></form></div><div id="connecting"><div class="wrap">Connecting to socket.io server</div></div><div id="messages"><div id="nicknames"></div><div id="lines"></div></div><form id="send-message"><input id="message"><button>Send</button></form></div></body></html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment