gpt4 book ai didi

listview - jQuery 移动错误 "cannot call methods on listview prior to initialization"

转载 作者:行者123 更新时间:2023-12-03 11:43:52 24 4
gpt4 key购买 nike

我正在动态填写 <ul data-role="listview">然后调用location.href="#Results"列表在哪里,最后是 listview('refresh') .

所有这些都是在来自同一页面的 Ajax 请求的成功回调中完成的。它或多或少地工作,但我收到以下错误:

Uncaught cannot call methods on listview prior to initialization; attempted to call method 'refresh'

我猜 jQuery mobile 还没有构建 ListView 。我能做什么?

最佳答案

只需先调用不带任何参数的 listview 方法:

$('#myListview').listview().listview('refresh');

解决方案取自 http://www.gajotres.net/uncaught-error-cannot-call-methods-on-prior-to-initialization-attempted-to-call-method-refresh/

关于listview - jQuery 移动错误 "cannot call methods on listview prior to initialization",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10373618/

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