0

I'm trying to include a one-off introductory page using JavaScript before index.html to introduce the purpose of the app and addressing the issues that we face.

The page will be in front of index.page something like a full page pop up of introductory page. It'll only appear once every 20 visits? If there such a thing that can be done on JS. It is for iPhone app as Hybrid (HTML5, CSS3 and JS using Cordova 2.1 formerly Phonegap). I think there is?

4

1 回答 1

1

尝试使用 JavaScript 本地存储。

window.onload = function(){
     if( localStorage.seenIntro ){
         // Display Normal Page (user has seen intro)
     }else{
         localStorage.seenIntro = true;
         // Display Intro Screen
     }
}

这将检查是否定义了 localStorage 值,如果它是用户之前看过的页面,它将加载正常的网页。否则它将创建 localStorage 值并显示介绍屏幕。

于 2012-12-02T18:43:12.157 回答