使用jQuery Mobile卸载Prefetched Page

时间:2012-06-27 02:40:10

标签: javascript jquery jquery-mobile

使用jQuery Mobile,我可以手动预取外部页面,如下所示:

$.mobile.loadPage(
  "content.html",
  { showLoadMsg: true }
);

但我是否要从内存中手动删除该页面;从某种意义上说,“卸载”它?

由于

1 个答案:

答案 0 :(得分:2)

如果指定了id,则在您的jqm页面上

,您可以执行此操作。

$('#page2').remove();

example

另一种方法是使用$.fn.jqmData(), $.fn.jqmRemoveData() 参考here