$(function(){
  $("#chat #btn_send").click(post);
  $("#chat #message").keydown(function(e){
    if(e.keyCode == 13) post();
  });
});

var io = new RocketIO().connect();

io.on("chat", function(data){
  var m = $("<li>").text(data.name + " : " +data.message);
  $("#chat #timeline").prepend(m);
});

io.on("connect", function(){
  console.log("connect!! "+io.session);
  $("#type").text("type : "+io.type);
});

io.on("disconnect", function(){
  console.log("disconnect");
});

io.on("error", function(err){
  console.error(err);
});

// catch all events
io.on("*", function(event, data){
  console.log(event + " - " + JSON.stringify(data));
});

var post = function(){
  var name = $("#chat #name").val();
  var message = $("#chat #message").val();
  if(message.length < 1) return;
  io.push("chat", {name: name, message: message});
  $("#chat #message").val("");
};

@@ -327,48 +327,8 @@
 ()%7B%0A
-  console.log(%22connect!! %22+io.session);%0A
   $(
@@ -404,21 +404,34 @@
 %7B%0A  
-console.log(%22
+$(%22#type%22).text(io.type+%22 
 disc
@@ -472,24 +472,59 @@
 tion(err)%7B%0A 
+ if(typeof console !== %22undefined%22)
  console.err
@@ -592,16 +592,51 @@
 data)%7B%0A 
+ if(typeof console !== %22undefined%22)
  console

check console object before console.log()