AJAX call not firing after 5 keystrokes
问题 Why does this require more than 5 keystrokes before firing? $( document ).ready(function() { $("#zipcode").on("keyup", function(event) { // keyup function if(this.value.length == 5){ // if 5 time keyup then fire the ajax var zicpcode= $("#zipcode").val(); // get the value of zipcode $.ajax({ url: "http://pages.em.essilorusa.com/page.aspx?QS=773ed3059447707d2a7242227e94bba8efcc7ce6da09facd&zip="+zicpcode, type: "get", //send it through get method success: function(results) { var res = results