页面部分:
<%@ page language="java" import=".*" pageEncoding="utf-8"%>
<%
String path = ();
String basePath = ()+"://"+()+":"+()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP '' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="">
-->
<script type="text/javascript" src="ajax/jquery-">
</script>
<script type="text/javascript">
$(document).ready(function(){
$("#sub1").click(function(){
$.ajax({
type: "POST",
url: "ajax/TestAjax-execute?userName="+$(".userName").val(),
data: "name="+$(".uuu").val()+"&stu="+$(".fff").val(),
ess: function(msg){
alert(msg);
("in2").value("RRRRRRR");
}
});
});
});
</script>
</head>
<body>
<form action="" id="from1">
用户名:<input id="in1" type="text" class="userName">
context1:<input id="in2" type="text" class="uuu">
context2:<input id="in3" type="text" class="fff">
<i
Ajax使用jquery的实现 来自淘豆网m.daumloan.com转载请标明出处.