[英]In HTML5, can I store data to the 'localstorage' directly from server?
I have some large chunk of data that I want to send to the client and allow the user to edit it and send back to server, like a online editor. 我有一些大数据要发送给客户端,并允许用户对其进行编辑并发送回服务器,例如在线编辑器。 I want to leverage the HTML5 local storage feature.
我想利用HTML5本地存储功能。 But it seems it only works on the client side with JS.
但似乎它仅在JS的客户端上有效。
Want I want to do is: 我想要做的是:
sent from server
<localStorage id="mydata">LARGE CHUNK OF DATA</localStorage>
in my JS:
localStorage["mydata"] = "new data"
What I am doing now is: 我现在正在做的是:
sent from server
<div id="mydata" style="display: none;">BLAHHHHHH</div>
localStorage by definition is for storing storage locally . localStorage根据定义用于本地存储存储。 So you absolutely cannot control that from the server side without any sort of communication from client <-> server.
因此,如果没有客户端<->服务器的任何形式的通信,您绝对无法从服务器端进行控制。
Your server should either: 您的服务器应:
I hope this helps! 我希望这有帮助!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.