jquery、Ajax、struts的集成
Html代码:
<%@ page language="java" pageEncoding="utf-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>jquery ajax</title>
<link rel="stylesheet" type="text/css" media="screen"
href="screen.css" />
<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">
<script src="jquery.js" type="text/javascript"></script>
<script src="json.js" type="text/javascript"></script>
<script language="javascript">
$(document).ready(function() {
$("#bt").click( function() {
//$.post("send.do?method=query",
{"account":$("#account").val()},
//function(data) {
//})
$.ajax({
type:"post",
url:"send.do?method=query2",
data: "account="+$("#account").val(),//{"account":$("#account").val()},
success:function(data){
var ul = eval('('+data+')');
&n
相关文档:
四、常见Ajax编程框架
既然上述Ajax框架已经能工作了,为什么还有那么多的框架呢?
随着页面的复杂,可能需要书写大量的Javascript脚本来对页面中的DOM对象进行控制,工作量和复杂度会大大增加。Ajax编程框架通常利用面向对象的方法,对一些基本的对象和行为及 ......
XMLHttpRequest 对象使 AJAX 成为可能。
XMLHttpRequest
XMLHttpRequest 对象是 AJAX 的关键。
该对象在 Internet Explorer 5.5 与 2000 年 7 月发布之后就已经可用了,但是在 2005 人们开始讨论 AJAX 和 Web 2.0 之前,这个对象并没有得到充分的认识。
创建 XMLHttpRequest 对象
不同的浏览器使用不同的方法来创建 ......