jQuery mobile error “cannot call methods on listview prior to initialization”

前端 未结 7 1141
北海茫月
北海茫月 2020-12-25 13:11

I\'m dynamically filling a

    then calling location.href=\"#Results\" where the list is, and finally listview(
7条回答
  •  鱼传尺愫
    2020-12-25 13:56

    http://jquerymobile.com/demos/1.1.0/docs/api/events.html You have to hook on the pageinit event. You can't call any JQM methods prior to this. i.e.:

    $('#Results').bind('pageinit', function() {
      $('#myListview').listview('refresh');
    });
    

提交回复
热议问题