我想编个网页,其中包含一个输入框和一个button, 现在我想把用这个button来运行某个特定的java程序,而输入框中的当成运行java程序的参数,请高手赐教!!!

解决方案 »

  1.   

    典型的Ajax应用。很简单。用JQuery轻松实现
      

  2.   


    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>无标题文档</title>
    <script src="jquery-1.3.2.js"></script>
    <script>
    $(document).ready(function(){
    //var test = "hello";
    $("#btn").click(function(){
     //test("hello");  //这里可以是java new一个对象再调用函数
     $("#test").attr("value",test("hello"));
    });

    function test(test){
         return test;
    }
    });
    </script>
    </head><body>
    <input type="text" id="test" />
    <input type="button" id="btn" value="点击" />
    </body>
    </html>
      

  3.   

    demo:
    http://api.jquery.com/jQuery.getJSON/
      

  4.   

    还有运行java程序的输出结果怎么显示出来?
      

  5.   

    dwr,jQuery,xmlHttp Ajax都可以的啊