Sakai
Error output
1 Answer(s)      3 years and 4 months ago
Posted in : JSP-Servlet

Can anyone please assist me; The printed output should be:

The product is 10. But instead of it I got; The product is undefined.
Can anyone trace what went wrong of my code pls?

===========================================================================

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Do Me</title>
<script type="text/javascript">
function Do(){
var product;
var x;
x = 10;
product = 1;
product = product * x;
document.getElementById('result').innerHTML = "The products is "
+ product.value + "!";
}
</script>
</head>
<body onload="Do()">
<div id="result"></div>

</body>
</html>
View Answers

February 1, 2010 at 10:32 AM


Hi Friend,

Try the following code:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Do Me</title>
<script type="text/javascript">
function Do(){
var product;
var x;
x = 10;
product = 1;
product = product * x;
document.getElementById('result').innerHTML = "The products is "
+ product+ "!";
}
</script>
</head>
<body onload="Do()">
<div id="result"></div>

</body>
</html>

Thanks









Related Pages:
output error
output error  this is my program import java.io.*; public class separate { public static void main(String[] args)throws IOException...]; for (k=0;k } } if i enter "my name" as the input the output
output error - JSP-Servlet
output error  /*hi friends, the given below is my servlet program error? How can i solve this problem? */ HTTP Status 500... report message description The server encountered an internal error
Error output - JSP-Servlet
Error output  Can anyone please assist me; The printed output should be: The product is 10. But instead of it I got; The product is undefined. Can anyone trace what went wrong of my code pls
I/O Program output error
I/O Program output error  Hello All, I am working on a program that requries me to read and analyze a .txt file and output the results to a .txt file, but I am getting incorrect output. I have been successfull with part
input output
Input And Output       Introduction The Java I/O means Java Input/Output and is a part... used for writes byte to output stream. It implements a buffered output
Error
state then city will not come in dropdown list and it give me error as 'Unknown Runtime Error'. This error come only in IE browser, but in other brower it shows me proper output. Please anybosy can give me remedy on that..... Thank you
Input and Output package
Input and Output package  Hi guys, My professor used input and output... she used in.readint() out.writeln() commands to read input and print output. she created two new objects directly to use this statements. /* input and output
output
output  Sir,I am experiencing some problems with the output of this program.I got some useful help this website,but the output of the program isn't producing what it should.let me explain the output below is what happen when
Input And Output
Input And Output       Introduction The Java I/O means Java Input/Output and is a part of java.io... for writes byte to output stream. It implements a buffered output stream
Output of this one - Java Interview Questions
Output of this one   public class Test { int i=-277; { try... { System.out.println("Error"); } } catch(Exception e... errors. The following code displays "Executed" as an output. public class
Output Previous or Next Day of the Month
Output Previous or Next Day of the Month   Please Help! I need... or previous day: The program should output the next day's or previous day's date... happens. And then Extend the program to do the following: Extend the output
PHP SQL Output
PHP SQL Output       This example illustrates how to display the output fetched as a result... need to show the output to the console or web page of the application
compile error
no errors and java A [output Hello World],up to this fine. Then I saved the same program with Test.java and try to compile with javac test.java an error like
error come
error come  com.techi.bean.Employee cannot be cast to [Ljava.lang.Object;... i display the data action to jsp using set list atribute on action...[]) it.next(); using System.out.println("ID: " + it.next()); } output is in obect
Error - JDBC
username and password....Try Again"); } /* TODO output your page
Output of flex
Output of flex  hi....... please provide the name of the output file. What is the output of flex applications? please rply ASAP........ Thanks
triangle output
triangle output  program to get the following output
how can i get output pls urget tell me
how can i get output pls urget tell me  HTTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception
triangle output
triangle output  program to get the following output: * *   Hi Friend, Please specify the pattern properly. Thanks
What will be the Output?
What will be the Output?  int[] number = {5,3,6,10,1} int temp; for (int i=0; inumbers[j]) { temp=numbers[i]; numbers[i]=numbers[j] number[j]=temp
What is the output if....
What is the output if....  Here is my code. what is the output...");   When we put 50 as a lower limit value, output comes: Entering... as a lower limit value, output comes: Entering the try block. Exiting the try block
output of the program
output of the program  public static int sum(List list) { int sum = 0; for ( Iterator iter = list.iterator(); iter.hasNext(); ) { int i = ((Integer)iter.next()).intValue(); sum += i; } return sum
xml output
xml output  generate an xml output in the following format <FileCount> <DOC>AA <RTF>BB <PDF>CC <Total>DD where AA=total number of .DOC files found BB=total number of .RTF files found,etc
what is the output?
what is the output?  public class MyAr{ public static void main(String argv[]) { int[] i=new int[5]; System.out.println(i[5]); } }   It gives ArrayIndexOutOfBoundsException as you haven't add element to array. Correct
what will the output
= (Parent) sonu; p.play(); What will be the output of above section of code
run time error
the error.   Here it works and showing output. Have you save the file... output for any program ...   Post your code.   public class... it doesn't showing any output. what should i do now?   Here it works
JSP Error 500
;% response.sendError(500, "Generate Error"); %> </html> Output... JSP Error 500          JSP Error 500 is to generate error status 500
<identifier> expected error
expected error    expected error print(" import java.util.... reSort( BufferedReader input, BufferedWriter output... to output, //rearrange such that females precede males but their //order
Java error stream
the execution of a program. The execution of program display an output and error... from class System are the standard output error and standard error stream... Java error stream      
what is the error - Java Beginners
what is the error  What is the compile time error that i am getting... is creating the compile time error such as : - ? CANNOT FIND SYMBOL ? because you... this .correct code is this if you don?t want such type of error EG : - import java.lang.
error
error  while iam compiling iam getting expected error
compile time error
compile time error  my program compile successfully and make the class file also but when i tried to do next command to see the output,it showing error that "could not find or load main class fibbo" fibbo is my class name
compile time error
compile time error  my program compile successfully and make the class file also but when i tried to do next command to see the output,it showing error that "could not find or load main class fibbo" fibbo is my class name
compile time error
compile time error  my program compile successfully and make the class file also but when i tried to do next command to see the output,it showing error that "could not find or load main class fibbo" fibbo is my class name
Error-
Error-   Hello, I would like to know about XSD file. I try to print XML file but I am getting error SAXException-- says Content is not allowed in prolog. Please help me
PHP Error handling
error echo($test); ?> The output of the following code is given... the script: The output is given below : Error: [512] Value must be 1 or below...PHP Error handling Your application must have an error handling codes. Without
to solve the error - Java Beginners
= x[i]; x[i] = x[i+1]; x[i+1] = temp; } } } } } the output say..., Your code having error : You not have declare any main method So java.lang.NoSuchMethodError: main error occur and you add this main method
error
error  i have 404 error in my program plz tell me yhe solution about
error
error  i have 404 error in my program plz tell me yhe solution about
PHP Error handling
PHP Error handling: PHP provides so many techniques to handle error, if error occurs an error message is send to the browser. Error handling should...: die() statement We will see that what will be the output if we use die
Error in a code. - Java Beginners
Error in a code.  This is the question I posted yesterday: "I'm... and the output text area. A user is asked to type in a number. The first button when pressed... should give an appropriate error message. The first part works perfectly fine
JSP Error Page
JSP Error Page          JSP Error Page is used to specify the custom error page and runtime error occurs with an exception being thrown, the custom
JLabel for output
Java: JLabel for output Why using JLabel for output is usually bad... idea after the user interface is already displayed. For output JTextField is often a better choice. The use of JLabel for output is mentioned because some
error
error  java.lang.unsupportedclassversionerror:bad major version at offset 6 how to solve this????   Hi, Please check the version of framework used and also the JDK version. This type error also comes when java file
error
error
jsp error - JSP-Servlet
jsp error  how to remove below error:: exception org.apache.jasper.JasperException: java.lang.NullPointerException root cause java.lang.NullPointerException  Hi Friend, It seems that something has
error
error  When I deploye the example I have this message cannot Deploy HelloWorld Deployment Error for module: HelloWorld: Error occurred during deployment: Exception while deploying the app [HelloWorld
error!!!!!!!!!
error!!!!!!!!!   st=con.createStatement(); int a=Integer.parseInt(txttrno.getText()); String b=txttname.getText(); String c=txtfrom.getText(); String d=txtto.getText

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.