Created
January 4, 2012 22:22
-
-
Save rpersaud/1562514 to your computer and use it in GitHub Desktop.
Figuring out the most efficient javascript method for autocomplete
This file contains hidden or 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
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/themes/base/jquery-ui.css" type="text/css" media="all" /> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js" type="text/javascript"></script> | |
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js" type="text/javascript"></script> | |
<meta charset="utf-8"> | |
<script> | |
$(function() { | |
var availableTags = [ | |
"ActionScript", | |
"AppleScript", | |
"Asp", | |
"BASIC", | |
"C", | |
"C++", | |
"Clojure", | |
"COBOL", | |
"ColdFusion", | |
"Erlang", | |
"Fortran", | |
"Groovy", | |
"Haskell", | |
"Java", | |
"JavaScript", | |
"Lisp", | |
"Perl", | |
"PHP", | |
"Python", | |
"Ruby", | |
"Scala", | |
"Scheme" | |
]; | |
$( "#tags" ).autocomplete({ | |
source: availableTags | |
}); | |
}); | |
</script> | |
<div class="demo"> | |
<div class="ui-widget"> | |
<label for="tags">Tags: </label> | |
<input id="tags" /> | |
</div> | |
</div> |
jquery ui site - http://jqueryui.com/demos/autocomplete/#default
yui2 autocomplete - http://developer.yahoo.com/yui/autocomplete/
Question - is this the most efficient, easy to setup, and use autocomplete method out there?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Minimum files to get this to work - jquery, jquery-ui, jquery-ui-css.