Created
March 29, 2010 23:49
-
-
Save saltybeagle/348568 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var searching = false; | |
var search_string = ''; | |
$('#courseSearch').keyup( | |
function(){ | |
if (this.value.length > 2) { | |
if (search_string != this.value) { | |
search_string = this.value; | |
clearTimeout(searching); | |
WDN.jQuery('#courseSearchResults').html('<img src="/wdn/templates_3.0/css/header/images/colorbox/loading.gif" alt="Loading search results" />'); | |
searching = setTimeout(function(){fetchCourseSearchResults(search_string);}, 750); | |
} | |
} else { | |
WDN.jQuery('#courseSearchResults').html(''); | |
} | |
} | |
); | |
function fetchCourseSearchResults(q) | |
{ | |
WDN.get(UNL_UGB_URL+'courses/search?q='+escape(q)+'&format=partial', null, function(content){WDN.jQuery('#courseSearchResults').html(content);}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment