首页
IT
登录
6mi
u
盘
搜
搜 索
IT
JQuery
JQuery
xiaoxiao
2021-03-25
83
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:
false
21
})
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>
转载请注明原文地址: https://ju.6miu.com/read-17843.html
技术
最新回复
(
0
)