This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
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: 63211

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] [Bear's FrontMan] [About Bear] [Books by Bear]
Have you checked out Aspose?
subject: System.out.println equivalent?
It's not a secret anymore!