Javascript jquery自动完成源不工作

Javascript jquery自动完成源不工作,javascript,jquery,autocomplete,Javascript,Jquery,Autocomplete,我从中复制源代码并将相对url替换为绝对url,但是当我在localhost中测试页面时,autocomplete小部件不起作用。有人能帮我吗 <html lang="en"> <head> <meta charset="utf-8" /> <title>jQuery UI Autocomplete - Remote with caching</title> <link r

我从中复制源代码并将相对url替换为绝对url,但是当我在localhost中测试页面时,autocomplete小部件不起作用。有人能帮我吗

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

jQuery UI自动完成-带缓存的远程
.ui自动完成加载{
背景:白色url('http://jqueryui.com/resources/demos/autocomplete/images/ui-anim_basic_16x16.gif右中无重复;
}
$(函数(){
$(“#鸟”).autocomplete({
来源:“http://jqueryui.com/resources/demos/autocomplete/search.php",
最小长度:2
});
});
鸟:

您不能向其他主机发出请求。localhost与jqueryui.com不同,因此您被

I replace source as
阻止。”http://localhost/mirt_search.php“
,此页面将按照自动完成文档中的描述进行响应。但它仍然不起作用。什么wrong@Derek
http://localhost/mirt_search.php?term=200
返回一个json数据,apache日志没有任何警告/错误。@Zhao-它不起作用可能是因为返回了数据,因为当我用数组替换你的链接时,它可以工作:@Derek当我将mirt_search.php?term=xxx返回的数据处理到搜索字段时,这个小部件可以工作。但是如果设置为
source:“mirt\u search.php”
则不会work@Zhao-那么可能是因为同一原产地政策。