Skip to content

Instantly share code, notes, and snippets.

@mritzco
Created September 17, 2013 08:12
Show Gist options
  • Save mritzco/6591410 to your computer and use it in GitHub Desktop.
Save mritzco/6591410 to your computer and use it in GitHub Desktop.
Console.log very simple trick to see your debugging messages on tablets, phones or other devices.
/* Style a layer to display the console.log messages */
#consolediv {
position: absolute;
top:0;
left:0;
bottom:0;
overflow: auto;
font-size: 10px;
color: #333;
width:200px;
}
/*
* @author Itzco
* @version 0.1
* console.log
* This is a very simple trick to debug in tablets or other devices. I was missing my console.log messages
* Add into your HTML code: <div id="consolediv"></div>
*/
var console = new myconsole();
console.log("hello");
function myconsole()
{
this.log = function(msg){
$("#consolediv").append("<p>" + msg + "</p>");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment