total word taken form search box and send ajax cal with total word
i have problem with search functionaility with ajax call and php.here my problem is searching character by character using keyup function.its taking some little bit itme. i want total word searching.please any body help to me开发者_JAVA技巧 how to take total word and send ajax cal with total word not single character
If I understand your question correctly:
use the blur-Eventhandler instead of the keyUp Eventhandler. That way your Event will only be triggered if the user leaves the inputfield with which he's trying to search.
So instead of:
$("selector").keyUp(function(e) { your ajaxCode; }
Try:
$("selector").blur(function(e) { your ajax Code; }
use change
$('#selecter').change(function(){
var val = $(this).val();
$.ajax({
type: "POST",
url: "some.php",
data: {value=val},
success: function(msg){
alert(msg);
}
});
});
http://api.jquery.com/change/
精彩评论