$(document).ready(function(){
//add an event handler, on blur, execute all this function:
$('#nomeInput').keypress(function(){
$.post("testeBasico_1.php", {nomeInput : $('#nomeInput').val()}, function(resposta) {
for (var x = 0, tamanhoDados = resposta.dados.length; x < tamanhoDados; x++){
$('#data').append(resposta.dados[x]+'<br>');
}
$('#data').append('<br />'+resposta.venhoDoInput);
}, "json");
});//end of keypress;
$('#nomeInput').blur(function(){
alert('here, I would like to grab the value we see on the input field at this precise moment.');
});
});
If $(this) is a reference of an object firing some event, am wondering: can we still have $(this) when no event is in place?
So, since blur is an event listener. What does it listen? “the move out from an element”. Is that anonymous function, a event handler? Like something that will do something after the even as been listen?