Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
161 views
in Technique[技术] by (71.8m points)

javascript - Updating Web App code without reloading it

Is there any way or possibility to update an apps code and have the client adopt it without reloading the app/website? I mean updating live application code, like adding or removing functionality.

The iPad asks for user permission every 24 hours for fullscreen webapps, for native apps it does not. Once you grant permission it will not ask again but if you reload the app, which you usually have to when you push an update, it will ask again if 24h passed.

We are installing iPads into Taxis and want to track connectivity around the city with geolocation data, but we can't do it reliably since the app would ask the guest for permission. We also would like to provide some location based features but wen can't do it because if one guest says "No", it will impact all next guests since the iPad only allows aksing twice and then you have to wait some time before you can ask for using Geolocation again,

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

By update the code I presume you mean live code reload or changing the modules loaded on a page without changing it.

This would require you to have an infrastructure library that allows you to either reload or add modules of code to your applications. ncore allows this

Next you would need a communication channel from the server or some other remote end point to send new modules or module reload commands to the client browser.

The concept being that you have a websocket open and you send one of two commands

  • add module : url
  • reload module : name

The app in the browser would then either load and add that module from an url or reload that module.

This is basically remote control over the state of an application in a users browser.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...