Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to print values in console using scriplet in javascript while a function is called [duplicate]

How to print values in console (like System.out.println() in java) using scriplet in javascript while a function is called ? if i used System.out.println("test") in scriplet the values is getting printed while a jsp form is loading but i want it to print only when a java script is called.

like image 765
hemalatha karunakaran Avatar asked Jan 03 '14 09:01

hemalatha karunakaran


2 Answers

 System.out.println ("test");

That is java and you cannot execute that on client side.

You might looking for

console.log("");

And while page loading it's printing because the jsp you are submitting processing on server side and java code executes there.

In short:

like image 178
Suresh Atta Avatar answered Sep 19 '22 23:09

Suresh Atta


Use:

console.log('Hello World!');
like image 41
Moritz Petersen Avatar answered Sep 19 '22 23:09

Moritz Petersen