我想知道如何调用从HTML Java方法(我使用HTML5)使用Java脚本。我试着用小程序,但这没有工作。我不得不采取在HTML文件中的下拉框的值,并把它带到一个Java方法来处理它。
I want to know how to call a java method from HTML (I Use HTML5) using java script. I tried using Applets but this didnt work. I have to take the value of a drop down box in the html file and take it to a java method to process it.
您正在寻找的是AJAX。这是非常容易做到的库如 jQuery的
What you are looking for is AJAX. It's extremely easy to do with a library such as jQuery
$.get('your/servlet').done(function(data) {
// data is the data returned by the request
});