国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

jQuery - AJAX ??

AJAX? ??????

AJAX = ??? JavaScript ? XML.

AJAX? ??? ??? ? ???? ??? ?????.

AJAX? ???? ??????? ??? ??? ???? ???? ????? ?????? ????? ? ????. ?? ?? ???? ?? ???? ??? ????? ??? ????? ? ??? ?????.

AJAX? ???? ?? ?? ??????? ???? ?????? ?? ?? ?? ????? ?? ???? ???.

AJAX? ??? ????? Sina Weibo, Google Maps, Kaixin.com ? ?????.

jQuery ? AJAX ??

JQuery? CSS3 ? ??? ????(IE 6.0+, FF1.5+, Safari 2.0+, Opera 9.0+)? ???? ?? js ????????. jQuery? ???? ???? HTML ?? ? ???? ?? ?? ??????, ????? ??? ????, ? ???? AJAX ?? ??? ?? ??? ? ????.

jQuery AJAX ???? ???? HTTP Get ? HTTP Post? ???? ?? ???? ???, HTML, XML ?? JSON? ??? ? ???, ? ?? ???? ? ???? ??? ??? ?? ??? ? ????.


?:

?? ??? ?? ?? ??:

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>php中文網(wǎng)(php.cn)</title>
    <script src="http://libs.baidu.com/jquery/1.10.2/jquery.min.js"></script>
    <script type="text/javascript">
        $(function(){
            //按鈕單擊時(shí)執(zhí)行
            $("#testAjax").click(function(){
                //Ajax調(diào)用處理
                var html = $.ajax({
                    type: "POST",
                    url: "text.php",
                    data: "name=garfield&age=18",
                    async: false
                }).responseText;
                $("#myDiv").html('<h2>'+html+'</h2>');
            });
        });
    </script>
</head>
<body>
<div id="myDiv"><h2>通過 AJAX 改變文本</h2></div>
<button id="testAjax" type="button">Ajax改變內(nèi)容</button>
</body>
</html>

?? PHP ?? ??? ??? ? text.php? ??? ??????.

<?php
  $msg='Hello,'.$_POST['name'].',your age is '.$_POST['age'].'!';
  echo $msg;
?>

?? ??? , JQuery Simple Ajax ?? ??? ?????.

???? ??
||
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>php中文網(wǎng)(php.cn)</title> <script src="http://libs.baidu.com/jquery/1.10.2/jquery.min.js"></script> <script type="text/javascript"> $(function(){ //按鈕單擊時(shí)執(zhí)行 $("#testAjax").click(function(){ //Ajax調(diào)用處理 var html = $.ajax({ type: "POST", url: "text.php", //調(diào)用text.php data: "name=garfield&age=18", async: false }).responseText; $("#myDiv").html('<h2>'+html+'</h2>'); }); }); </script> </head> <body> <div id="myDiv"><h2>通過 AJAX 改變文本</h2></div> <button id="testAjax" type="button">Ajax改變內(nèi)容</button> </body> </html>