summer dreamer

全新的 香港中文版 WordPress 網站!

Note

jquery Ajax 實現載入資料前動畫效果的示例程式碼

asynchronous javascript and xml
$(document).ready(function(){
     $.ajax({
        type:”get”,
        cache:false,
        url:”ajaxpage.aspx?t=getcity”,
        dataType:”json”,
        beforeSend:function(){
           $(“#vvv”).append(‘<img src=”../../images/loading.gif”  />’);
        },
        success:function(data){
           $(“#city”).html(data.info);//新增下拉框的option
        },
        complete: function() {$(“#vvv”).remove();
        }

     })
})

Comments are Closed

Theme by Anders Norén