Ok so here is the code you are looking for (and one of my homemade functions, enjoy). This works and should show you what you want.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script src="https://socketio.mtgox.com/socket.io/socket.io.js"></script>
</head>
<body>
<div id="output">
</div>
<script>
var mtgox = io.connect("http://socketio.mtgox.com/mtgox");
var ticker = "d5f06780-30a8-4a48-a2f8-7ed181b4a13f";
var trade = "dbf1dee9-4f2e-4a08-8cb7-748919a71b21";
var depth = "24e67e0d-1cad-4cc0-9e7a-f8523ef460fe";
var output = document.getElementById("output");
mtgox.on("connect", function(e) {
LogTextToConsole(output, "Connected");
mtgox.send({
"channel":depth,
"op":"unsubscribe"
});
LogTextToConsole(output, "Unsubscribed from Depth");
mtgox.on("message", function(msg) {
if( (msg.channel == ticker) && (msg.origin == "broadcast") ) {
LogTextToConsole(output, msg.ticker.last.display_[Suspicious link removed]String());
}
});
});
function LogTextToConsole(ob, inc, b, c) {
// Create Div Container for Object and assign Class Name
var divText = document.createElement("div");
var defaultColor = '#FFFFFF';
c = c || defaultColor;
b = b || false;
divText.className = "divStringHolder";
// Check to see if the object is a string, if it is display it.
if (typeof inc == "string") {
// Assign text to div
divText.textContent = inc;
// If bold, bold it
if (b == true) {
// Adds bold if requested
divText.style.fontWeight = "bold";
}
if (c != defaultColor) {
// Changes from the default to something specified
divText.style.backgroundColor = c;
}
else {
// Default Notification Color
divText.style.backgroundColor = defaultColor;
}
/* IMPORTANT: Inserts before the first child therefore creating a
* top to bottom effect where the newest information is on the top
* and the oldest is on the bottom */
ob.insertBefore(divText, ob.firstChild);
}
}
</script>
</body>
</html>
http://www.introspectivity.com/TradeThatCoin/testcode.phpWhat I think was going wrong for you was where you had your script. I've always seen them at the bottom of the body for sockets, that's where I've been putting mine anywhere with no problems.
also biggest thing they don't specifically tell you
mtgox.send({
"channel":depth,
"op":"unsubscribe"
});
That is how you unsubscribe and subscribe to channels. If you need help subscribing to the lag channel later to late me know
I didn't realize the socket io and the websocket were that close in syntax
Edit: had to change some of the leftover code from mine