我从jQuery 自动完成演示复制源代码并将相对 url 替换为绝对 url,但是当我在 localhost 中测试页面时,自动完成小部件不起作用。谁能帮我?
<html lang="en">
<head>
<meta charset="utf-8" />
<title>jQuery UI Autocomplete - Remote with caching</title>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.1/themes/base/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.1/jquery-ui.js"></script>
<link rel="stylesheet" href="http://jqueryui.com/resources/demos/style.css" />
<style>
.ui-autocomplete-loading {
background: white url('http://jqueryui.com/resources/demos/autocomplete/images/ui-anim_basic_16x16.gif') right center no-repeat;
}
</style>
<script>
$(function () {
$("#birds").autocomplete({
source: "http://jqueryui.com/resources/demos/autocomplete/search.php",
minLength: 2
});
});
</script>
</head>
<body>
<div class="ui-widget">
<label for="birds">Birds:</label>
<input id="birds" />
</div>
</body>
</html>