Mobilebone.remove(domOrId)

(v2.7.0+)清除页面级别的DOM元素,并连带id标识和缓存一起清除。

参数

其它说明

对于Ajax请求的页面,如果没有专门指定,这些页面的id是使用Mobilebone.getCleanUrl(null, 'xxx.php')方法的返回值(假设请求地址是'xxx.php')。

(v2.7.2+)data-reload新增基于指定id自动删除同一类别页面功能,是一种设计更友好的自动删除实现。

返回值

-

使用示例

// 移除id为idJustUnique的页面
Mobilebone.remove("idJustUnique");

// 移除类名为.pageRootReload的所有页面
[].slice.call(document.querySelectorAll('.pageRootReload')).forEach(function (page) {
    Mobilebone.remove(page);
});

// 移除#rootReload下所有<a>元素加载的页面
[].slice.call(document.querySelectorAll('#rootReload a')).forEach(function (ele) {
    Mobilebone.remove(ele);
});

// 移除请求//detail.php?id=1234这个地址生成的页面
Mobilebone.remove("//detail.php?id=1234");