【发布时间】:2012-08-15 05:14:12
【问题描述】:
我的网站上有一个FirstPage.html。
当网站加载时(FirstPage.html 加载),我想显示 WelcomePage.html 至少 5 秒(即使 FirstPage.html 完成加载)。
有人可以帮忙吗!
【问题讨论】:
标签: jquery jsp web-applications jquery-mobile pageload
我的网站上有一个FirstPage.html。
当网站加载时(FirstPage.html 加载),我想显示 WelcomePage.html 至少 5 秒(即使 FirstPage.html 完成加载)。
有人可以帮忙吗!
【问题讨论】:
标签: jquery jsp web-applications jquery-mobile pageload
为什么不让WelcomePage.html成为实际的主页,然后在后台将FirstPage.html添加到jquery mobile DOM中。然后,在 X 秒后或页面完成加载到 DOM 后重定向到 FirstPage.html。
这是文档:http://jquerymobile.com/test/docs/pages/page-cache.html
更新
使用 我给你的墨水,你需要在一个单独的JS文件中添加以下代码。
$.mobile.loadPage( FirstPage.html, { showLoadMsg: false } );
您需要在 WelcomePage.html 的头部包含这个 JS 文件,在您包含 jQuery 之后,但在您包含 jQuery mobile 之前。
这会将 FirstPage.html 加载到 DOM 中。然后调用你的其他代码(我认为)
【讨论】: