gpt4 book ai didi

javascript - 未捕获的异常 : cannot call methods on slider prior to initialization; attempted to call method 'disable'

转载 作者:行者123 更新时间:2023-11-30 07:17:31 27 4
gpt4 key购买 nike

以下代码块有效:

$("#data\\[User\\]\\[notify_one_day_out\\]").val("0");
$('#data\\[User\\]\\[notify_one_day_out\\]').slider('disable');
$('#data\\[User\\]\\[notify_one_day_out\\]').slider('refresh');

$("#data\\[User\\]\\[notify_one_week_out\\]").val("0");
$('#data\\[User\\]\\[notify_one_week_out\\]').slider('disable');
$('#data\\[User\\]\\[notify_one_week_out\\]').slider('refresh');

$("#data\\[User\\]\\[notify_one_month_out\\]").val("0");
$('#data\\[User\\]\\[notify_one_month_out\\]').slider('disable');
$('#data\\[User\\]\\[notify_one_month_out\\]').slider('refresh');

$("#data\\[User\\]\\[notify_on_release_date_change\\]").val("0");
$('#data\\[User\\]\\[notify_on_release_date_change\\]').slider('disable');
$('#data\\[User\\]\\[notify_on_release_date_change\\]').slider('refresh');

$("#data\\[User\\]\\[notify_available_for_purchase\\]").val("0");
$('#data\\[User\\]\\[notify_available_for_purchase\\]').slider('disable');
$('#data\\[User\\]\\[notify_available_for_purchase\\]').slider('refresh');

当我尝试用以下代码替换上面的内容以压缩代码时:

      $('[id^="data"]').val('0');
$('[id^="data"]').slider('disable');
$('[id^="data"]').slider('refresh');

我得到:

uncaught exception: cannot call methods on slider prior to initialization; attempted to call method 'disable'

最佳答案

最近我遇到了非常相似的问题并更换了

$('.sth').slider('disable');

与:

$('.sth').attr('disabled', true);

有帮助。也许这值得一试。

关于javascript - 未捕获的异常 : cannot call methods on slider prior to initialization; attempted to call method 'disable' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9445792/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com