function ajax() {
    $.post("ajaxServlet",{username:"小达"},
    function (data) {
        alert("服务器返回的数据"+data)
    })
}

更多推荐

jquery方式发送post请求