2013-10-30 6 views

답변

1

$(document).ready(function() { 
    $('.postForm').on('blur', '#post_title', function (e) { 
     alert('hi'); 
     $(".postForm #post_url_link").blur(); 
    }); 

    function postTitleCheck() { 
     $(".postForm #post_title").blur(); 
    } 
}); 

Don't Register the event handler in the function.As function is called a new event handler is registered every time which leads to many event handler.

예를

click 1 - handler count -1 
click 2 - handler count -2 
click 3 - handler count -3 
..... and so on 

을 시도하고 DOM ready handler

+0

작품에서 당신의 코드를 포장하지만 catch되지 않은 ReferenceError가 얻을 : postTitleCheck가 정의되어 있지 않습니다 –

관련 문제