Reputation: 4232
I have a script which allows to display bing search results: JsFiddle
If you type a letter you will see the results for this letter. If you then do backspace and then type the same letter you will not get any results, so:
This happens becouse I set a code to take clear the results if the val of input is empty like this:
$('#searchbox').live('keyup', function(){
var teq = $('#searchbox').val();
doSearch(teq);
if (teq == '')
{
clearResults();
}
});
So by clearing the results like this I'm actually causing a problem the same time becouse there are no results for the second time a same query is made. So my question is: How can I clear the results in a way that I would still be able to do the same query? Which means:
Upvotes: 1
Views: 690
Reputation: 381
You have in your code this comment:
// if our search is not blank AND is not what we last searched for
therefore I changed the statement
if ((search!='') && (search!=lastSearch))
to:
if ((search!=''))
You can see the result: http://jsfiddle.net/F9T7E/10/
Upvotes: 1