jsp中使用jquery的ajax功能



jsp中使用jquery的ajax功能

jquery 在 jsp 中的应用 源代码 和 演示

摘要:

$(document).ready(function() {
$(“a”).click(function() {
$(“#decimal”).val(‘这是一个例子’);
$(“#inputtext”).val(‘控制text’);

});

/*
$(“a”).click(function() {
alert(“Hello world!”);
});
*/

});

function convertToDecimal(){
$.ajax({
type: “GET”,
url: “/jqueryjsp/response”,
data: “key=” + $(“#key”).val(),

$(“#rating”).html(“按键代码:” + $(“key”,xml).text());
}
})
clear();
}


function clear(){
var key = document.getElementById(“key”);

key.value=”";
// alert( “keypress code: ” + $(this).html() );
}
jquery 在 php 中使用的例子很多,但是没有 jsp 的,

我修改了ajax on java 中的第三章的例子,应用了jquery实现了ajax

源代码 在附件中

 

使用方法

将压缩包中的文件放到

在tomcat 中webapps中。

详见readme