JQuery_AJAX简单笔记

来源:互联网 发布:网络买卖纠纷 编辑:程序博客网 时间:2024/05/17 04:01
 1  <script type="text/javascript"> 2  3         //Ajax方法 4               $.ajax({ 5                    type: "post", 6                    cache: false,        7                    url: "Handler1.ashx", 8                    data: "name=小明&age=13", 9                    success: function f(e) {10                        $("#btn").click(function () { 11                             alert(e)12                         })13                     }14                 });15 16 17 //        //post和get方法一样用法18         $(function () {19             $.ajaxSetup({20             cache:false21             })22             $("#btn").click(function () {23                 $.get("Handler1.ashx", { "name": "小红", "age": "18" }, function (e) {24                     alert(e);25                 })26                 //load  载入远程 HTML 文件代码并插入至 DOM 中。27                 $("#d").load("Handler1.ashx", { "name": "小红", "age": "18" })28             })29 30            31 32         })33 34        35        36     </script>

 

0 0
原创粉丝点击