javascript如何与后台数据库交互

2025-02-27 11:32:43
推荐回答(3个)
回答1:

可以用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

回答2:

使用ajax调用后台应用,应用中写与数据库的交互

回答3:

可以使用dwr调用