toxicious
-
Posts
55 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by toxicious
-
-
Yeah, realised now that I need to put the "remove code" for the searchtip there. But since I am providing that callback function, why does it still lag? Is there something else causing it maybe?read the documentation. http://api.jquery.com/jQuery.get/ to make it async, you need to provide a callback function to be run when the request is completed, which is the function literal you are defining after you make the request. -
I'm trying to implement insta-search on my webpage, and I have got it working.But there is one problem: it doesn't seem to be completely async. Here is the page with the search box: http://gaddons.tk Oh, and don't visit it in IE since it doesn't work at all in IE (the whole div turns white lol, have to make another thread about that).If you type something quite fast the site will either hang or some of the letters you typed won't get typed, the syndroms of sync requests. I am searching "onkeyup" using this javascript method:
function instaSearch(acount, searchTerm){//Abort opened requests to speed it upif(runningRequest){ request.abort();} //Add searchtip - this doesn't seem to get added either, though if I add alerts before and after I can see it....$('#searchBox').after('<p id="searchText">Searching...</p>');runningRequest=true;request = $.get('addonstable.php',{ search: encodeURIComponent(searchTerm) , count: acount},function(data){ $("#table").html(data); runningRequest=false;});//Remove searchtip$('#searchText').remove();}
Any clue on how I can make it completely async?I know at least two pages that has a completely async search, Google and the Swedish site "prisjakt.nu", so it can't be a impossibility
Completely async insta-search
in JavaScript
Posted
As you can see, no big changes. I am using an anonymous function with no name. Are you sure it needs to be named success?