<form id="result" name="result" action="/HelloStruts2/views/register.action" method="post">
    <label>UserName</label>
    <input type="text" name="userBean.username" value="" id="result_userBean_username"/>
    <input type="submit" id="registerSubmit" value="Submit"/>

</form>
$(document).ready(function(){
     $('#result').on('submit',function(e){
         e.preventDefault();
//阻止默认的事件 $.ajax({
//this is the php file that processes the data and send mail url: "register.action", //GET method is used type: "POST", //Do not cache the page cache: false, //success success: function (html) { $('#content').html(html); } }); }) })

 

 
posted on 2013-01-03 15:03  Black Bean  阅读(424)  评论(0编辑  收藏  举报