jQuery Mobile Page refresh mechanism

前端 未结 6 1181
小鲜肉
小鲜肉 2020-11-30 02:23

I\'m having a lot of pain understanding how jQuery Mobile handles pages refresh after an ajax update.

I\'m having a two pages - unique file site: a search engine.

6条回答
  •  甜味超标
    2020-11-30 02:30

    This answer did the trick for me http://view.jquerymobile.com/master/demos/faq/injected-content-is-not-enhanced.php.

    In the context of a multi-pages template, I modify the content of a

    ...
    in a Javascript 'pagebeforeshow' handler and trigger a refresh at the end of the script:

    $(document).bind("pagebeforeshow", function(event,pdata) {
      var parsedUrl = $.mobile.path.parseUrl( location.href );
      switch ( parsedUrl.hash ) {
        case "#p_02":
          ... some modifications of the content of the 
    here ... $("#foo").trigger("create"); break; } });

提交回复
热议问题