可以用ajax
推荐用jquery的ajax。
$.ajax({
type: "POST",
url: "some.php",
data: "name=John&location=Boston",
success: function(msg){
alert( "Data Saved: " + msg );
}
});
背景无刷新,将参数"name=John&location=Boston",传到后台some.php后,取得数据库的数据msg;然后用js处理msg
使用ajax调用后台应用,应用中写与数据库的交互
可以使用dwr调用