Is there a better way aside from alert()?
Firefox:
Tools > JavaScript Console
Opera:
Tools > Advanced > JavaScript console
Internet Explorer:
Install JScript Debugger from:
<http://www.microsoft.com/downloads/details.aspx?FamilyID=2f465be0-94fd-4569-b3c4-dffdf19ccd99&DisplayLang=en>
After that you can use JScript [Debug] object wich represents dubugger
output and [debugger] statement which is equivalent of breakpoint:
for(i = 1; i<5; i++) {
// Print i to the Output window.
Debug.write("loop index is " + i);
// Wait for user to resume.
debugger
}
I forgot to mention that new menu option adds up to View > Script
Debugger (not in Tools). I remember I nearly got crazy before I found
it :-)
For Mozilla-based browsers, see
<http://developer.mozilla.org/en/docs/DOM:window.dump>, specifically
the "Notes" section.
HTH,
-- David
I did both and no dice in firefox.
> Doesn't print to the java console in either IE6 or FF1.5
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Works as designed.
> Is there a better way aside from alert()?
As was said.
PointedEars
> Doesn't print to the java console in either IE6 or FF1.5
window.dump is not supposed to write to the Java console, nor to the
JavaScript console.
It will dump/write to a console window on your system (e.g. a command
line window under MS Windows) if you start Mozilla with the right
parameters.
Not sure where you got the idea that IE supports window.dump at all.
--
Martin Honnen
http://JavaScript.FAQTs.com/
Take a look on how to enable it here:
<URL:http://developer.mozilla.org/en/docs/window.dump>, I've just
googled the url.
There are some debug extensions for JavaScript (have you seen Venkman
<URL:http://www.mozilla.org/projects/venkman>?), I preffer the old
alert, document.title = "blabla" and document.write haha :)
--
Jonas Raoni Soares Silva
http://www.jsfromhell.com