Using JavaScript to Interact with the Browser
Dynamic web pages often require you to access and in some cases even manipulate things beyond the HTML elements. JavaScript provides a rich set of objects and functions that allow you to access information about the screen, browser window, history, and more.
The phrases in this chapter describe ways to use the screen, window, location, and history objects that provide JavaScript with an interface to access information beyond the web page. Additional phrases describe utilizing those objects to implement cookies, popup windows, and timers.
Writing to the JavaScript Console
The JavaScript console can be an important tool when debugging problems in your jQuery and JavaScript code. The console log is simply a location where you can view data output from the JavaScript code. Each of the major browsers has a console log tool that displays the output.
To output data to the console log, use console.write(DEBUG_STRING) and pass it the text that you want to display on the console.