DOJO向服务器发送数据

1:Sending Data to the Server Using GET
<button dojoType="dijit.form.Button" id="helloButton">
        Hello World!
        <script type="dojo/method" event="onClick">
        dojo.xhrGet({
           url: 'HelloWorldResponseGET.jsp,
           load: helloCallback,
           error: helloError,
           content: {name: dojo.byId('name').value }
        });
        </script>
     </button>
Please enter your name: <input type="text" id="name">

2:Sending Data to the Server Using POST
<form id="myForm" method="POST">
      Please enter your name: <input type="text" name="name">
</form>
<script type="dojo/method" event="onClick">
        dojo.xhrGet({
           url: 'HelloWorldResponseGET.jsp',
           load: helloCallback,
           error: helloError,
           content: {name: dojo.byId('name').value }
        });
</script>

你可能感兴趣的:(java,jsp,dojo)