Say I have a mobile web app written using JQuery Mobile, this app retrieves data from a database to populate a variety of lists and other UI elements in a single webpage, but multiple pages as defined in JQuery Mobile.
假设我有一个使用JQuery Mobile编写的移动Web应用程序,该应用程序从数据库中检索数据,以在单个网页中填充各种列表和其他UI元素,但是在JQuery Mobile中定义了多个页面。
After retrieving this data and populating all the lists the user is allowed to enter and remove information, such as adding items to lists, modifying entries, so on and so forth. These updates must be pushed back to the server.
在检索此数据并填充所有列表之后,允许用户输入和删除信息,例如向列表添加项目,修改条目等等。必须将这些更新推送回服务器。
My question is, if say the system is disconnected from a connection to the website, would it be safe to assume that if we keep checking for a resumed connection (through Ajax) that the mobile browser will remember all the information added and modified in the lists (as it was all done in java?). Is there an upwards limit to how many form elements a browser can support and it may start 'forgetting' values it has set so by the time it reconnects to the main server it won't know what changes to send to it?
我的问题是,如果说系统与网站的连接断开连接,那么可以安全地假设,如果我们继续检查恢复的连接(通过Ajax),移动浏览器将记住所有添加和修改的信息。列表(因为它都是在java中完成的?)。是否有一个向上限制浏览器可以支持多少个表单元素,它可能会开始“忘记”它设置的值,所以当它重新连接到主服务器时,它将不知道要发送给它的更改?
2 个解决方案
#1
0
Sounds like you should be storing that information in Cookies and then when a connection is again achieved match the Cookies to the information in database and if there is a difference store the Cookies in the database.
听起来你应该将这些信息存储在Cookies中,然后当再次实现连接时,将Cookie与数据库中的信息相匹配,如果存在差异,则将Cookie存储在数据库中。
#2
2
If you're using HTML5, you could use the local storage mechanism until your connection to the service is restored.
如果您使用的是HTML5,则可以使用本地存储机制,直到恢复与服务的连接。
#1
0
Sounds like you should be storing that information in Cookies and then when a connection is again achieved match the Cookies to the information in database and if there is a difference store the Cookies in the database.
听起来你应该将这些信息存储在Cookies中,然后当再次实现连接时,将Cookie与数据库中的信息相匹配,如果存在差异,则将Cookie存储在数据库中。
#2
2
If you're using HTML5, you could use the local storage mechanism until your connection to the service is restored.
如果您使用的是HTML5,则可以使用本地存储机制,直到恢复与服务的连接。