Michael Warren
Michael Warren

Reputation: 205

Autocomplete - not working

I open this in Firefox and start typing in the text box and I am not given any options. What am I missing?

<script type='text/javascript' language='javascript'     src='http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/jquery-ui.min.js'></script>
<SCRIPT>
    $(function() {
        var availableTags = [
            "ActionScript",
            "AppleScript",
            "Asp"
        ];
        $( "#tags" ).autocomplete({
            source: availableTags
        });
    }); 
</SCRIPT>

<html>
<body>
<DIV class=demo>
    <DIV class=ui-widget>
        <LABEL for=tags>Tags: </LABEL>
        <INPUT id=tags> </INPUT>
    </DIV>
</DIV><!-- End demo -->
</body>
</html>

Upvotes: 1

Views: 996

Answers (1)

stealthyninja
stealthyninja

Reputation: 10371

Try

<html>
<head>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type='text/javascript' language='javascript'     src='http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/jquery-ui.min.js'></script>
<SCRIPT>
    $(function() {
        var availableTags = [
            "ActionScript",
            "AppleScript",
            "Asp"
        ];
        $( "#tags" ).autocomplete({
            source: availableTags
        });
    }); 
</SCRIPT>
</head>
<body>
<DIV class=demo>
    <DIV class=ui-widget>
        <LABEL for=tags>Tags: </LABEL>
        <INPUT id=tags> </INPUT>
    </DIV>
</DIV><!-- End demo -->
</body>
</html>

You were missing jQuery.

Upvotes: 1

Related Questions