问题描述
一个传说说如果你无法解释给六十岁,你真的不明白自己,请有可能现在...
要寻找一个想法/参考如何做到这一点
亲爱的观众朋友/朋友,是新手了Spring MVC / angularjs。我想开发一种应用像登记表,其中的姓名,年龄,电话没有保存到数据库这里当用户处于离线(如果用户的wifi是关闭的),应该显示您可以在脱机的网页,如果用户保存了他的提交应显示项目本地保存按钮细节..
现在,当用户在网上(WiFi是ON)到previous离线输入的数据值,应用程序应该被保存到数据库中,并应尽量在服务器成功地保存的显示...
我们应该联机或脱机找到每一次的互联网连接与我们的应用。
附上我的示例场景图片
a legend said If you can't explain it to a six-year-old, you really don't understand it yourself please make it possible now...am looking for a idea/reference how to do thisDear Viewers/Friends, am newbie to spring mvc/angularjs. i want to develop one kind of application like registration form where name,age,phone no saving into database here when the user is in offline (if user wifi is off)it should display that you are in offline in page and if user saved his details by submitting the button it should be display items saved locally..now when user in online (wifi is ON) to the application the previous entered data values in offline should be saved into database and should be display as saved succesfully in server...we should find each time internet connection online or offline with our application.am attaching my sample scenario image of
推荐答案
如果我来回答这个问题,按照问题的名号:
If i have to answer this question as per the question title then:
- 您可以使用
在线
导航
对象的方法。 - 会有检查与
在线/离线
的条件。 - 现在,你可以使用
的localStorage
将数据设置为本地系统。 - 当用户进入
离线
然后将其保存到本地。 - 现在,如果系统被连接到互联网执行
在线
方法。 - 在
在线
检查您可以使用AJAX将数据提交给服务器。 - 在服务器端,你必须使用你的逻辑将数据保存到特定的表。
- You can use
online
method ofnavigator
object. - There would be a condition to check with
online/offline
. - Now you can use
localStorage
to set the data to the local system. - When user goes
offline
then save it to local. - Now if the system is connected to internet execute
online
method. - in
online
check you can use ajax to submit the data to server. - At serverside you have to use your logic to save the data to the specific tables.
这篇关于如何使用Spring MVC / Angularjs查找用户在离线到Application或网上申请的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!