dongshai2022 2013-05-25 14:22 采纳率: 100%
浏览 65
已采纳

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

The code is same on both Web server and local server but using firebug I get two kinds of response links:

Works fine

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"

And this is my 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条回答 默认 最新

  • duan0708676887 2013-05-25 15:06
    关注

    Most likely your local server is running windows which is not case sensitive and your production server is running linux which is case sensitive, check the uppercased names and see if any of them shouldn't be

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 matlab yalmip kkt 双层优化问题
  • ¥15 如何在3D高斯飞溅的渲染的场景中获得一个可控的旋转物体
  • ¥88 实在没有想法,需要个思路
  • ¥15 MATLAB报错输入参数太多
  • ¥15 python中合并修改日期相同的CSV文件并按照修改日期的名字命名文件
  • ¥15 有赏,i卡绘世画不出
  • ¥15 如何用stata画出文献中常见的安慰剂检验图
  • ¥15 c语言链表结构体数据插入
  • ¥40 使用MATLAB解答线性代数问题
  • ¥15 COCOS的问题COCOS的问题