I am trying to build a sample web application using Ajax.
Currently I have 3 components in the web server:
1. a html file (A.html)
2. a
java script (A.js)
3. a
JSP (A.js)
I also have MYSQL as my backend.
The entries in the DB will be modified through some other web application.
The goal of the application is that once A.html is requested, it shall request
A.jsp using Ajax (XMLHttpRequest) and then draw the response into a graph.
Part of A.html has code like:
displayInBarGraph function is present in A.js and looks like below:
showBarGraph method is also present in A.js and is as below:
The problem that I am facing is that I get
alert number 2 before alert number 1, why is it so?
I need to set the hidden input type value of A.html from the location in which alert number 1 is called and use that value from the location in which alert number 2 is called.
Regards,
Joshua