문제

I need to build an application to run inside a web browser that works offline (whitout any internet connection) and store data in a way that I can after with internet connection be able to upload these data to a server.

for example for example an HTML form

<html>

<body>

    <form>

        Name: <input type="text" name="name" /><br />
        E-mail: <input type="text" name="email" /><br />

        <input type="submit" name="save" />
    </form>

</body>

so when I submit this form the browser saves the data somewhere and when I be connected I can upload it to a server...

do anybody knows a way to do that??

도움이 되었습니까?

해결책

Use local storage to save offline data. You can use AJAX (jQuery makes it easy: see here) to try to post the local storage data to your server. You may want to set an interval to post to the server.

다른 팁

Saving to local storage (in browsers that support it) and then syncing with a web server is how I would do it.

The real problem here is that browsers were not really build for that so you'll need to find some clever solutions and also would only work in modern browsers.

A native application might be a better way to go.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top