I’ve been learning about web programming, and I am currently stuck on getting a method coded on the server client(in Java) to run when I click a button on webpage(in html and javascript).
Basically, I created a Java server client where upon running, I can go to web browser and type “localhost:8080/index.html” and the page will show up with buttons and some buttons have javascript attached to it so that I can click and interact.
However, I have one method in Java which I want Javascript to access it when I click a button. How do I do that?
Thank you very much.
Don’t take this the wrong way, but the question alone shows that you still have to do a lot of reading about web development.
Since you’re working with Java I would recommend googling for “java web development tutorial” or stuff like that.
Here are a couple of links to get you started:
http://www.apl.jhu.edu/~hall/java/Servlet-Tutorial/
http://www.mkyong.com/tutorials/spring-mvc-tutorials/
Good luck!