File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes System.out.println equivalent? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "System.out.println equivalent?" Watch "System.out.println equivalent?" New topic

System.out.println equivalent?

Herbert Kornfeld
Ranch Hand

Joined: Apr 16, 2003
Posts: 32
How can you do what is an equivalent of System.out.println in Javascript in order to debug?
Many Thanks
James Swan
Ranch Hand

Joined: Jun 26, 2001
Posts: 403
alert("my debug text");
sunitha reghu
Ranch Hand

Joined: Dec 12, 2002
Posts: 937
use alert(" system testing");
Paul McKenna
Ugly Redneck
Ranch Hand

Joined: Jul 08, 2000
Posts: 1006
to write it on the page you would use
document.write("Your Text");

Commentary From the Sidelines of history
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63530

to write it on the page you would use document.write("Your Text");

This technique is only useful in on-page script that executes while the page is loading. After the page is laoded, this will not do what you want!

[Asking smart questions] [About Bear] [Books by Bear]
wood burning stoves
subject: System.out.println equivalent?
It's not a secret anymore!