双重促动模糊事件

I have javascript code, which should be executed once at focus shift. Everything works, but this code is carried out two times for some strange reason, thus I give TWO alert windows.

$(document).ready(function() {
    $('#username').blur(function() {

        var formData = {
            "username":$('#username').val()
        };

        $.ajax({
            url:'check.php',
            type:'POST',
            data:'jsonData=' + $.toJSON(formData),
            success: function(res) {
                alert(res);
            }

        });
    });
});

What am I doing wrong?

查看全部
weixin_33749242
weixin_33749242
2012/07/01 14:49
  • ajax
  • javascript
  • jquery
  • 点赞
  • 收藏
  • 回答
    私信

2个回复