Created
June 10, 2014 15:15
-
-
Save salcode/d9da9f6bbf62b0bc2702 to your computer and use it in GitHub Desktop.
jQuery error_log() function that creates a div on the page and outputs the contents into it. Useful when troubleshooting IE8 javascript
This file contains 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
// BEGIN DEV JS CODE for error_log | |
jQuery(document).ready( function($) { | |
$log = $('<div><h3>Log</h3></div>').css({ | |
'position': 'absolute', | |
'top': 0, | |
'left': 0, | |
'width': 300, | |
'border': '1px solid red', | |
'background': 'white', | |
'color': 'black' | |
}); | |
$('body').append( $log ); | |
error_log = function( content ) { | |
$log.append( content + "<br>\n" ); | |
} | |
}); | |
// END DEV JS CODE for error_log |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment