Created
March 1, 2015 13:57
-
-
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
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
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