<script>

$(document).ready(function()

{

var data_all_item = "" ;

var data_all_email = "" ;

var data_all_cell = "" ;

 

    //抓取搜尋顯示出來的所有會員資訊 item email cell

$('.click_me').each(function()

{

data_all_item += ";" + $(this).attr('item') ;

data_all_email += ";" + $(this).attr('email') ;

data_all_cell += ";" + $(this).attr('cell') ;

}) ;

 

$('#all_sent').attr("all_item",data_all_item.substring(1)) ;

$('#all_sent').attr("all_email",data_all_email.substring(1)) ;

$('#all_sent').attr("all_cell",data_all_cell.substring(1)) ;

 

$('.click_me').click(function()

{

//101.06.25 edit by liyun 寄送信件時改變游標

$("body").css('cursor','wait');

//---------------------------------------

$.ajax({

url: 'module/sent_mail.php?item=' + $(this).attr('item') + '&email=' + $(this).attr('email') + '&cell=' + $(this).attr('cell') ,

error: function(xhr)

{

//101.06.25 edit by liyun 寄送信件完畢恢復預設游標

$("body").css('cursor','default');

$("textarea").css('cursor','default');

//--------------------------------------------

  alert('Ajax request 發生錯誤');

},

success: function(response)

{

//101.06.25 edit by liyun 寄送信件完畢恢復預設游標

$("body").css('cursor','default');

$("textarea").css('cursor','default');

//--------------------------------------------

alert('通知信已寄出!') ;

}

});

}) ;

 

$('#all_sent').click(function()

{

//101.06.25 edit by liyun 寄送信件時改變游標

$("body").css('cursor','wait');

//---------------------------------------

$.ajax({

url: 'module/sent_mail.php?all_item=' + $(this).attr('all_item') + '&all_email=' + $(this).attr('all_email') + '&all_cell=' + $(this).attr('all_cell') ,

error: function(xhr)

{

//101.06.25 edit by liyun 寄送信件完畢恢復預設游標

$("body").css('cursor','default');

$("textarea").css('cursor','default');

//--------------------------------------------

  alert('Ajax request 發生錯誤');

},

success: function(response)

{

//101.06.25 edit by liyun 寄送信件完畢恢復預設游標

$("body").css('cursor','default');

$("textarea").css('cursor','default');

//--------------------------------------------

alert( response ) ;

//alert('全部通知信已寄出!') ;

}

});

}) ;

});

 

 

</script>

---------------------------------------------------------------------------------

 

另外,在sent_page7_mail.php (也就是實際負責執行寄mail的頁面)中

加入PHP語法:sleep(5);  以彰顯效果!

arrow
arrow
    文章標籤
    jquery 原創造型
    全站熱搜

    passsky 發表在 痞客邦 留言(0) 人氣()