Write some messages to the Java console : debug « Development « JavaScript Tutorial






<html>
<head>
<title>Debug Example</title>
<script type="text/javascript">

function test_function() {
    java.lang.System.out.println("Entering function.");

    var iNumber1 = 5;
    var iNumber2 = 10;

    java.lang.System.out.println("Before calculation.");
    var iResult = iNumber1 + iNumber2;
    java.lang.System.out.println("After calculation.");

    java.lang.System.out.println("Leaving function.");
}

test_function();


</script>
</head>
<body>
</body>
</html>








4.5.debug
4.5.1.Use alert dialog as a way to debug
4.5.2.Write some messages to the Java console