-
-
Save remmi11/4cf2b512ab101bffcf29 to your computer and use it in GitHub Desktop.
print console.log output to a debug div (for mobile)
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
if (typeof console != "undefined") | |
if (typeof console.log != 'undefined') | |
console.olog = console.log; | |
else | |
console.olog = function() {}; | |
console.log = function(message) { | |
console.olog(message); | |
$('#debugDiv').append('<p>' + message + '</p>'); | |
}; | |
console.error = console.debug = console.info = console.log |
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
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=utf-8" /> | |
<style> | |
#debugDiv {height: 200px; width: 500px; border: 1px solid #333; overflow:scroll;} | |
</style> | |
<script src="console.js"></script> | |
</head> | |
<body> | |
<div id="debugDiv"></div> | |
<script> | |
console.log('test'); | |
</script> | |
</body> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment