我有一个小型 jQuery 移动网站。
- 都是单个
.html
文件 - 它有一些编辑功能(查看、编辑、保存)
- 全部适用于
ajax/json/web 服务
我的大部分页面都使用来自 web 服务的数据,通过 AJAX 和 JSON
,所以我经常使用以下内容:
$(document).on( 'pagebeforecreate', '#monday', function() {
// do some stuff on before create, load data with AJAX
});
现在,我如何强制重新创建该页面(pagebeforecreate 事件)以便再次运行内部的 AJAX(从服务器获取最新数据)?
最佳答案
使用 pageBeforeShow
而不是 pageBeforeCreate
。
来自jqm documentation , 关于创建事件。
Note that these events will only fire once per "page", as opposed to the show/hide events, which fire every time a page is shown and hidden.
关于javascript - jQuery Mobile - 如何强制重新创建页面 - pagebeforecreate 事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13569235/