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

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度