您好,欢迎来到爱go旅游网。
搜索
您的当前位置:首页jquery读取页面loadgetpostajax四种方式代码写法_jquery

jquery读取页面loadgetpostajax四种方式代码写法_jquery

来源:爱go旅游网

load
代码如下:
$("#result").load("aaaa.asp #ccc");

get
代码如下:
$.get("aaaa.asp", { action:"get",name:"lulu" },
function(data, textStatus){
$("#result").html(data);
//alert(this);
//alert(data);
//alert(textStatus);
});

post
代码如下:
$.post("aaaa.asp", { action:"post",name:"lulu" },
function(data, textStatus){
$("#result").html(data);
});

ajax
代码如下:
$.ajax({
type: "get",
url: "http://www.gxlcms.com/rss",
beforeSend: function(XMLHttpRequest){
//$('数据加载中,请稍后')
//.insertAfter($("#btn_ajax"))
//.fadeIn('slow')
//.animate({opacity: 1.0}, 3000)
//.fadeOut('slow', function() {
//$(this).remove();
//});
},
success: function(data, textStatus){
$("#result").html("");
$("item",data).each(function(i, domEle){
$("#result").append("
  • "+$(domEle).children("title").text()+"
  • ");
    });
    },
    complete: function(XMLHttpRequest, textStatus){
    //alert("加载完成!");
    },
    error: function(){
    //请求出错处理
    }
    });

    Copyright © 2019- igat.cn 版权所有 赣ICP备2024042791号-1

    违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com

    本站由北京市万商天勤律师事务所王兴未律师提供法律服务