download1323 2012-04-25 11:23
浏览 54
已采纳

jquery ui autocomplete无缘无故地停止工作

In a website cms I am using jquery autocomplete. I worked like a charm. But suddenly, after a few weeks, it stopped working. Absolutely no code was changed in this period. I'm using jquery 1.6.2 and jquery ui 1.8.13. Here's the code:

$(function() {
    var artists = [<?php getArtists(); ?>];
    $("#artistsearch").autocomplete({
        source: artists,
        select: function(event, ui){
            $("#artistsearch").val(ui.item.artistsearch);
        },
        change: function(event, ui) { $("#search").submit(); }
    });
});

The array artists is a correct array, but too long to post here. I hope that there is anyone over here that can help me out on this one.

Thanks in advance, Richard

I've got a form with a field artistsearch

Edit: Thanks people..

I didn't receive notification mails, so a little late with my response.

The echo is IN the getArtist() function and delivers a nice array. As I stated in my original question the whole thing DID work, but suddenly stopped working, without changing any code. At first I thought that it could be an invalid item in the array, so I hardcoded a simple, 2 items array, and it also didn't work.

Could it be a server issue? I realy am confused with this and I didn't see this behavior in my careere before.

  • 写回答

2条回答 默认 最新

  • doupaoshu8334 2012-05-08 07:05
    关注

    Problem solved!

    It turned out that some of the array-items where breaking the array. In the getArtist function I switched the quotes, e.g.: "'" to '"'

    Richard

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 stata安慰剂检验作图但是真实值不出现在图上
  • ¥15 c程序不知道为什么得不到结果
  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题