jQuery自动完成在本地服务器上工作但在Web服务器上失败?

时间:2013-05-25 14:22:02

标签: php javascript jquery codeigniter

Web serverlocal server上的代码相同,但使用firebug我会得到两种响应链接:

工作正常

GET  http://localhost/www.test.co.uk/index.php/home_Controller/getSearch/r

“NetworkError:404 Not Found

 GET   http://www.test.co.uk/index.php/home_Controller/getSearch/r"

这是我的JS:

  $(document).ready(function(){

            $('#performsearch').keyup(function(e){

                //if key is enter stop search
                if(e.which == 13)
                    {
                        e.preventDefault();
                    }
                    var searched = $('#performsearch').val()
                    var fullurl = $('#hiddenurl').val() + 'index.php/home_Controller/getSearch/' + searched
                $.getJSON(fullurl,function(result){
                    var elements = [];
                    $.each(result,function(i,val){
                       elements.push(val.title)
                    })
                    $('#performsearch').autocomplete({
                        source : elements
                    })

                })
            })
        })

1 个答案:

答案 0 :(得分:1)

很可能你的本地服务器正在运行不区分大小写的Windows,而你的生产服务器运行的是区分大小写的linux,检查大写的名称,看看是否有任何不应该