如何在同一网页中的小程序之间共享数据? [英] How to share data between applets in the same web page?

查看:24
本文介绍了如何在同一网页中的小程序之间共享数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在同一个网页中有几个小程序,我想在它们之间共享数据.

I have several applets in the same web page and i would like to share data between them.

执行此操作的最佳解决方案是什么?

What is the best solution to do this ?

感谢您的回复,我会尽量更具体:

Thank you for your responses, I will try to be more specific :

我的网页上有 3 个小程序:

I have 3 applets on my web page :

  • 第一个将从网络服务器下载文件
  • 第二个将用于修改本地文件
  • 第三个将修改后的文件发送回服务器

每个小程序都可以处理文件,我想将文件的路径、名称和其他属性存储在小程序之间共享的对象中.

Each applet will work on the files and I would like to store path, name, and other properties of files in an object which would be shared between the applets.

使用 Javascript 在小程序之间进行通信的解决方案对我来说似乎不是很安全.

The solution consisting of using Javascript to communicate between applets seems not very secure for my case.

我将阅读有关 AppletContext 的更多信息.

I will read more about AppletContext.

推荐答案

Java<->JS 是一种在小程序之间获取信息的经过验证的方法,但另请参见 AppletContext.

Java<->JS is one well tried way to get information between applets, but see also the AppletContext.

这个接口对应一个小程序的环境:包含小程序的文档和其他小程序在同一个文档中.

This interface corresponds to an applet's environment: the document containing the applet and the other applets in the same document.

它提供如下方法:

流是一种非常通用且强大的信息交换方式.

A stream is a very generic and powerful way to exchange information.

这篇关于如何在同一网页中的小程序之间共享数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆