1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml">
5 <title>OpenLayers Debug Example</title>
6 <link rel="stylesheet" href="style.css" type="text/css" />
7 <script src="../lib/Firebug/firebug.js"></script>
8 <script src="../lib/OpenLayers.js"></script>
9 <script type="text/javascript">
10 function consoleLog() {
11 OpenLayers.Console.log("This is the result of an OpenLayers.Console.log() call");
13 function consoleWarn() {
14 OpenLayers.Console.warn("This is the result of an OpenLayers.Console.warn() call");
16 function consoleError() {
17 OpenLayers.Console.error("This is the result of an OpenLayers.Console.error() call");
19 function consoleDir() {
20 OpenLayers.Console.dir(OpenLayers);
22 function consoleDirxml() {
23 OpenLayers.Console.dirxml(document.getElementsByTagName('body')[0]);
28 <h1 id="title">Debug Example</h1>
33 Demonstrate console calls to a Firebug console. Requires Firefox. Mostly for developers.
37 <p>To run OpenLayers in debug mode, include the following script
38 tag <b>before</b> the tag that loads OpenLayers:
40 <pre> <script src="../lib/Firebug/firebug.js"></script></pre>
42 The path to firebug.js must be relative to your
43 html file. With this script included calls to OpenLayers.Console
44 will be displayed in the Firebug console. For browsers without
45 the Firebug extension, the script creates a Firebug Lite console.
46 This console can be opened by hitting <b>F12</b> or <b>Ctrl+Shift+L</b>
47 (<b>?+Shift+L</b> on a Mac). If you want the Firebug Lite console
48 to be open when the page loads, add <b>debug="true"</b> to the opening
49 html tag of your page. Open the console and click on the links below
50 to see console calls.</p>
53 <a href="javascript: void(consoleLog());">OpenLayers.Console.log()</a>
56 <a href="javascript: void(consoleWarn());">OpenLayers.Console.warn()</a>
59 <a href="javascript: void(consoleError());">OpenLayers.Console.error()</a>
62 <a href="javascript: void(consoleDir());">OpenLayers.Console.dir()</a>
65 <a href="javascript: void(consoleDirxml());">OpenLayers.Console.dirxml()</a>
68 <p>The Firebug website has a complete list of
69 <a href="http://www.getfirebug.com/console.html">console calls</a>.
70 Note that not all are supported with Firebug Lite.</p>