SOLVED, ERROR IN THE JAVASCRIPT-FILE
I’m trying to get a very simple autocomplete test page to work, using
http://www.devbridge.com/projects/autocomplete/jquery/
The source code I that can’t get to work looks like this:
<html lang="en">
<head>
<meta charset="utf-8" />
<title>test</title>
<link rel="stylesheet" href="stylesheets/test.css">
<script src="http://code.jquery.com/jquery-1.8.2.js"></script>
<script type="text/javascript" src="javascripts/jquery.autocomplete.js"></script>
<script>
var options, a;
jQuery(function(){
options = {lookup:['Jan', 'Feb']};
a = $('#query').autocomplete(options);
});
</script>
</head>
<body>
<input type="text" name="q" id="query" />
</body>
</html>
Am I missing something?
j is lower case in jQuery:
not
The rest of code has no problem i think. Anyway, try use some developing tools in order to debug your javascript codes. Something like Firebug, or new Firefox’s built-in development tools.(almost every modern browsers has such feature)
Another thing you can try is to write this code in document.ready function, like this: