2011-12-05 117 views
1

我在Firefox中打开此项,并开始在文本框中输入内容,但没有给出任何选项。我错过了什么?自动完成 - 无法正常工作

<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> 
+0

除了jquery ui源代码之外,你还引用了jquery源代码吗? – BNL

+0

也许在属性周围使用引号可以帮助解决问题。 – Tarik

回答

1

尝试

<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> 

你失踪的jQuery。

相关问题