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工作流
图生图工作流:藏族姑娘ComfyUI工作流
一只可爱的毛茸茸的猫ComfyUI工作流
一座巨大的野兽派建筑漂浮在热带风景中的贫民
一对葫芦ComfyUI工作流
一个漂亮的混血女孩ComfyUI工作流
汗血宝马ComfyUI工作流
梦幻中的一只猫咪ComfyUI工作流
一只猫捧着一条鱼ComfyUI工作流
猜你喜欢
声明:本站提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请发送到邮箱:admin@ipkd.cn,我们会在看到邮件的第一时间内为您处理!

3d文字360度旋转
iframe开发admin后台
会议人员60s签到倒计时插件
做一个好玩的时钟翻牌效果
jquery鼠标滑过图片边框特效(jquery.focus-follow插件)
css3结合svg做一个动态广告
jquery做一个漂亮挂墙动态时钟
利用CSS3代码编写45款按钮效果






