开发者

How to get page to be resident (if I don't have the server?)

With mobile web-apps becoming the ~next big thing.. I developed a small web page with mobile friendly characteristics, It runs great on both Android and i-Phone see here: http://dl.dropbox.com/u/4303088/gadgetdraftoknewdatac.html It is pure JS.. It gets data from Google Spreadsheets.

I can bookmark it on my Android phone and presumably on a i-Phone as well and since it is pretty small it is fairly responsive, but I cannot prevent the page from reloading. What I've read is that I would have to make changes to the webserver to set the page expiration (via headers?). At the moment I'm serving this from servers that I do not have that level of co开发者_Go百科ntrol over. This copy being served from dropbox for instance..

Is there any way to make this act more like an "Installed" app using straight HTML/CSS/JS???


I have two options for you and both are interesting to look at.

You can have a look at an online presentation from the website HTML5ROCKS to have a quick reference and demo of many HTML5/CSS3/JavaScript features. For example, you will see in the slides certain features such as new HTML5 form elements, WebSQL, WebSockets and Canvas.

The only problem is that many of those features are not yet available in many browsers. Have a HTML5 test to check it out for yourself!

I am keeping the best part for last because you could use a very innovative way to create cross-platform applications (desktop/mobile) based on web technologies.

Have a look at Titanium Mobile from appcelerator because you can create applications for iOS (iPhone/iPod Touch/iPad) and Android OS by using web technologies such as HTML5, CSS3, JavaScript, PHP, Ruby and Python. It is very simple to use! You create a page with your favorite web technologies and Titanium Desktop/Mobile creates an application with it. The best part is that it is free!

Have fun! :)


It would appear that this is what I was looking for.. Will try out shortly! http://html5doctor.com/go-offline-with-application-cache/ The answer is use a Manifest file:

The manifest file The file name is specified in your html

<!DOCTYPE html>
<html lang="en" manifest="/offline.manifest">
  // your html document
</html>

an example of a manifest file. Then have a file named offline.manifest <<<< note same name as in your html with something like::

# This is a comment
CACHE:
/css/screen.css
/css/offline.css
/js/screen.js
/img/logo.png

http://example.com/css/styles.css

And that is it! The solution seems to work on modern mobile devices, dramatically reducing DL time after 1st visit.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜