<script language=javascript>
    window.onload = function(){
      $("#btnGet").click(function(){
          $.ajax({
            type:'get',
           
            url:'http://www.cnblogs.com/rss',
            beforeSend:function(XMLHttpRequest){
                $("#btnGet").hide();
                $('<div>数据加载中,请稍后</div>')
      .insertAfter( $("#btnGet") )
      .fadeIn('slow')
      .animate({opacity: 1.0}, 3000)
      .fadeOut('slow', function()
      {
          $(this).remove();
      });
            },
            success:function(data,textStatus)
            {
                $("#showContent").html("");
                $("item",data).each(function(i,domEle){
                    $("#showContent").append("<li>"+$(domEle).children("title").text()+"</li>");
                });
            }
        });  
      }); 
    }
    </script>

    <input type=button id=btnGet value="获取cnblogs的首页信息"  />
    <div id="showContent"></div>

posted on 2009-05-17 22:28  Dot-Boy  阅读(183)  评论(0编辑  收藏  举报