views:

90

answers:

1

I run the script in IE 8 and get error message after typing in the input field:

//error message from IE8 Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; InfoPath.2) Timestamp: Mon, 7 Jun 2010 23:13:10 UTC

Message: Object expected Line: 570 Char: 394 Code: 0 URI: http://localhost/zhong/jquery-ui-1.8.2.custom.min.js

<script src="jquery-1.4.2.min.js"></script>
<script src="jquery-ui-1.8.2.custom.min.js"></script>
<link rel="stylesheet" type="text/css" href="jquery-ui-1.8.2.custom.css" />

<body>
Search: <input id="example" /> 
</body>

<script>
$(document).ready(function(){
var data = "Core Selectors Attributes Traversing Manipulation CSS Events Effects Ajax Utilities".split(" ");
$("#example").autocomplete(data);
});
</script>
+1  A: 

You need to pass data as the source option, like this:

$("#example").autocomplete({source: data});​

You can view a working demo here

Nick Craver
Bingo! btw, the web app you link to is very cool
phil
I actually used the autocomplete(array) from jquery/plugins. But what I intended to use is autocomplete(source) from jquery/ui. The two autocomplete() have the same name, yet different parameters and different reference. That's why i made the mistake.
phil
@phil - Yup, seen that at least a dozen times before..."the autocomplete plugin" is still the common phrase on SO, even though there are a few major players all called just "autocomplete", it's *definitely* confusing.
Nick Craver