1(function () {
2 var old = console.log;
3 var logger = document.getElementById('log');
4 console.log = function (message) {
5 if (typeof message == 'object') {
6 logger.innerHTML += (JSON && JSON.stringify ? JSON.stringify(message) : message) + '<br />';
7 } else {
8 logger.innerHTML += message + '<br />';
9 }
10 }
11})();
1Javascript: Outputting Data
2alert()
3Output data in an alert box in the browser window
4confirm()
5Opens up a yes/no dialog and returns true/false depending on user click
6console.log()
7Writes information to the browser console, good for debugging purposes
8WebsiteSetup.org - Beginner’s Javascript Cheat Sheet 5
9document.write()
10Write directly to the HTML document
11prompt()
12Creates an dialogue for user input
13