gpt4 book ai didi

ios - 更改页面在 jquery mobile ios 和 phonegap 中不起作用

转载 作者:行者123 更新时间:2023-12-01 19:09:19 25 4
gpt4 key购买 nike

我正在解释我目前正在开发的应用程序所面临的情况。

该应用程序由登录模块组成,该模块将数据存储到应用程序本地存储中。
现在,当我启动应用程序时,它会检查本地存储中的 key 并相应地调用应用程序中的 changepage。

如果我清除本地存储并重新启动应用程序,那么所有转换都完美无缺。但是,如果应用程序本地存储中已经存在数据并且应用程序已启动,它会将我带到定义的主屏幕。

我在那里有一个jquery listview。现在,当我在以后的场景中调用 changePage 时,什么都没有发生,即当我登陆主页时。但在第一种情况下,当我从登录屏幕开始时,一切正常。

这是注销的代码

localStorage.removeItem("userdata");
localStorage.removeItem("default_data");
$("#block-ui").show();
$.mobile.loading('show');
setTimeout(function(){
$.mobile.loading('hide');
$("#block-ui").hide();
$.mobile.changePage("index.html",{allowSamePageTransition:true,reloadPage:true,changeHash:false,transition:"slide"});
},2500);

最佳答案

最后我能够解决这个问题。

根据理解,jquery mobile 将 index.html 作为初始页面加载,并使用 ajax 将其他 html 页面加载到应用程序中。因此,基本级别永远不会从 index.html 更改为任何其他页面。

现在问题是由于以下语法

$.mobile.changePage("home.html",{allowSamePageTransition:true,reloadPage:true,changeHash:true,transition:"slide"});

我只是将其更改为以下内容:
$.mobile.changePage("home.html",{allowSamePageTransition:true,reloadPage:false,changeHash:true,transition:"slide"});

它开始起作用了。

无论如何感谢您的帮助。此外,您可以查看以下链接以更好地了解陷阱并相应地处理它们:

http://rip747.wordpress.com/2012/04/19/pitfalls-with-jquery-mobile-and-how-to-over-come-them/

关于ios - 更改页面在 jquery mobile ios 和 phonegap 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17699796/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com