Gia*_*tta 2 javascript splash-screen
我使用phonegap开发了一个移动应用程序.我有两个文件html(splash.html,index.html).所以,我希望应用程序以splash.html开头,在X秒后,将页面更改为index.html.
我怎么能用javascript做到这一点?
使用JavaScript:
setTimeout(function() {
window.location.href = 'index.html';
}, 2000);
Run Code Online (Sandbox Code Playgroud)
没有JavaScript:
<head>
<!-- ... -->
<meta http-equiv="refresh" content="2; url=index.html">
</head>
Run Code Online (Sandbox Code Playgroud)