jquery有哪些交互方式,下面web建站小编给大家详细介绍一下!
1、利用load实现交互
$("id").load("xx.txt",function(responseTxt,statusTxt,xhr){
if(statusTxt=="success"){
console.log("成功");
}
if(statusTxt=="error"){
console.log("失败:"+xhr.status+":"+xhr.statusTxt);
}
});
2、利用post实现交互
$.get("/json/index", {
name:"xiaomi",
sex:'男'
}, function(data, status) {
console.log(data + ":" + status);
});
3、利用get实现交互
$.get("xx.txt",null,function(data,status){
console.log(data+":"+status);
});
4、利用getJSON实现交互
$.getJSON("/json/index", {
name:"xiaomi",
sex:'男'
}, function(json) {
console.log(json.name);
});
5、利用jQuery.ajax()实现交互
$.ajax({
url : "/json/index",
type : "post",
async : true,
dataType : "json",
data : {
name:"xiaomi",
sex:'男'
},
success : function(result) {
console.log(result.name)
},
error : function(xhr) {
console.log("错误提示: " + xhr.status + " " + xhr.statusText);
}
});
上面是“jquery关于交互的几种方式”的全面内容,想了解更多关于 js 内容,请继续关注web建站教程。
当前网址:https://ipkd.cn/webs_2987.html
workflows工作流
1个粉红色头发可爱的女孩ComfyUI工作流
一个外国人在吹奏萨克斯ComfyUI工作流
1个黑发带着耳机项链的女孩ComfyUI工作流
一棵树从鸟笼里长出来的梦幻般场景
王家卫电视剧繁花海报效果comfyui工作流
一杯咖啡蒸汽形成云ComfyUI工作流
一幅3D农场游戏画面ComfyUI工作流
一只竹节虫ComfyUI工作流
猜你喜欢
声明:本站提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请发送到邮箱:admin@ipkd.cn,我们会在看到邮件的第一时间内为您处理!

3d文字360度旋转
纯CSS饼图效果
纯css制作卡通头像(随鼠标转头)
css3卡片动态滑动效果
js导出excel插件(兼容mac电脑Numbers表格)
jquery做一个漂亮挂墙动态时钟
利用css绘画棋盘布局(象棋)







