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
Ïà¹ØÎĵµ£º
WebÏîÄ¿ÖÐ×ÜÊÇ»áÓõ½Òì²½²Ù×÷£¬ÏÖÔÚµÄÒì²½²Ù×÷¿ÉÒÔÓø÷ÖÖ¸÷ÑùµÄ¿Ø¼þÀ´ÊµÏÖ£¬µ«ÊµÏÖÔÀí»¹ÊÇÒ»ÑùµÄ£¬±¾È˸üϲ»¶Ê¹ÓÃ×îÔʼµÄAjax²Ù×÷ȥʵÏÖÒì²½´¦Àí£¬±¾ÎĽöÏ׸øÄÇЩϲ»¶ÊµÏÖAjaxºÍÏîÄ¿ÖÐÒªÓõ½AjaxµÄÅóÓÑ¡£
AjaxʵÏÖÔÀí¾ÍÊǿͻ§¶Ëͨ¹ýjavascript²Ù×÷µ÷Ó÷ ......
XMLHttpRequest ¶ÔÏóʹ AJAX ³ÉΪ¿ÉÄÜ¡£
XMLHttpRequest
XMLHttpRequest ¶ÔÏóÊÇ AJAX µÄ¹Ø¼ü¡£
¸Ã¶ÔÏóÔÚ Internet Explorer 5.5 Óë 2000 Äê 7 Ô·¢²¼Ö®ºó¾ÍÒѾ¿ÉÓÃÁË£¬µ«ÊÇÔÚ 2005 ÈËÃÇ¿ªÊ¼ÌÖÂÛ AJAX ºÍ Web 2.0 ֮ǰ£¬Õâ¸ö¶ÔÏó²¢Ã»Óеõ½³ä·ÖµÄÈÏʶ¡£
´´½¨ XMLHttpRequest ¶ÔÏó
²»Í¬µÄä¯ÀÀÆ÷ʹÓò»Í¬µÄ·½·¨À´´´½¨ ......
ÇëÇó·½Ê½£¬·ÖΪGETÓëPOST£º
GET
×îΪ³£¼ûµÄHTTPÇëÇ󣬯ÕͨÉÏÍøä¯ÀÀÒ³Ãæ¾ÍÊÇGET¡£GET·½Ê½µÄ²ÎÊýÇëÇóÖ±½Ó¸úÔÚURLºó£¬ÒÔÎʺſªÊ¼¡££¨JSÖÐÓÃwindow.location.search»ñµÃ£©¡£²ÎÊý¿ÉÒÔÓÃencodeURIComponent½øÐбàÂ룬ʹÓ÷½Ê½:
var EnParam = encodeURIComponent(param);
URLÖ»Ö§³Ö´óÔ¼2KµÄ³¤¶È£¬¼´2 ......