2013-02-09 46 views
1

您好我有一個jQuery的函數,它有ajax方法,當焦點出文本框功能必須觸發。我有類AjaxPanel服務器端的按鈕,但是當我按下按鈕,按鈕操作不正確,然後永遠不執行集中了聚焦方法執行一次

jQuery("#drpProvider").focusout(function() { 
     var x; 

     var customer = 1; 
     $.ajax({ type: "POST", 
      url: "request.aspx/branchsafed", 
      contentType: "application/json; charset=utf-8", 
      data: JSON.stringify({ 

       customer: customer 

      }), 
      dataType: "json", 
      success: function (ret) { 
       var specification = ret.d; 

       if (ret.d == "no") { 

       } 
       else { 

        var temp = ret.d; 
        $("#blocklable").text(temp); 

       } 

      } 
     }); 


    }); 
+0

可以粘貼HTML代碼? – JohnJohnGa 2013-02-09 09:16:50

回答

1
<input id="title"> 

的javascript:

$('#title').focusout(function() { 
if($(this).val()) { 
    alert('!!'); 
    $(this).unbind('focusout'); 
} 
});