Skip to content

Instantly share code, notes, and snippets.

@evanhutomo
Created March 1, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save evanhutomo/0b6095c3e99d7de99d5c to your computer and use it in GitHub Desktop.
Save evanhutomo/0b6095c3e99d7de99d5c to your computer and use it in GitHub Desktop.
Just tried to subtitute console.log object with mine. This still first snippet version, so any suggestion, good critics, idea will be good and be heared :D. Thanks
var evLog = {
d: function(param){
var bCheck = $('body').children('#playground').length;
if(bCheck == 0){
console.log("playground not found");
var createDiv = document.createElement("div");
createDiv.setAttribute("id", "playground");
document.body.appendChild(createDiv);
}
var strBuilder;
strBuilder = "<code id='evcode'>" + param + "</code>";
document.getElementById("playground").innerHTML = strBuilder;
//console.log(strBuilder);
var codeStyle = document.getElementById('evcode'),
css = {
color: '#a0294c',
fontSize: '30px'
};
for(i in css){
codeStyle.style[i] = css[i];
}
}
}
//test
evLog.d(1+1);
evLog.d('yeahhhh');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment