Lotus Notes 隐藏/显示 div

发布于 2024-09-30 21:51:54 字数 364 浏览 2 评论 0原文

我无法在 Lotus Notes 6.5 电子邮件中编写一小段 javascript。 我正在构建一个 html,通过邮件将其作为 html 发送,并且在内部我想要一些链接来隐藏/显示一些 div。 我尝试使用 document.getElementById 但当我单击链接时出现以下错误:

"document.getElementById is not a function".

我正在考虑使用 document.getElementById(id).style.display='none' ; 隐藏它(如果我可以管理 div)。

有什么想法如何显示/隐藏我的 div 吗?

I cannot manage to make asmall piece of javascript working in a lotus notes 6.5 email.
I'm building a html, send it by mail as a html, and inside I would like to have some links to hide/show a few div.
I try to use document.getElementById but when I click on the link I have the following error:

"document.getElementById is not a function".

I'm thinking using a document.getElementById(id).style.display='none'; to hide it (if I can manage the div).

Any ideas how to show/hide my div?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

鸵鸟症 2024-10-07 21:51:54

Lotus Notes 中的 HTML 引擎与浏览器中的 HTML 引擎不同。我相当确定错误消息是正确的,即“document.getElementById 不是函数”——Notes 电子邮件中几乎不支持 javascript。

如果您需要在 Notes 中隐藏/显示某些内容,则必须创建一个带有操作的 Notes 表单并隐藏公式才能获得相同的效果。然后,可以发送电子邮件并将表单嵌入到电子邮件中,并且在收到电子邮件时将打开该表单而不是典型的备忘录表单。

请注意,大多数电子邮件客户端(Outlook 等)不太可能支持 JavaScript,因为它会打开安全漏洞。您可能会更幸运地向用户发送链接,然后让他们打开网页或 Notes 数据库,您可以更好地控制向他们呈现内容的方式。

The HTML engine in Lotus Notes is not anything like you'd get in a browser. I'm fairly certain the error message is correct when it says "document.getElementById is not a function" - there is little to no support for javascript in Notes emails.

If you need to have something hide/show in Notes, you will have to create a Notes form with actions and hide formulas to get the same effect. Then emails can be sent with the form embedded into the email, and when received the email will open that form instead of a typical memo form.

Note, it is unlikely most email clients (Outlook, etc) will support javascript due to the security holes it would open. You might have better luck sending a link to users and then having them open up a Web page or Notes database where you have more control over how things are presented to them.

乙白 2024-10-07 21:51:54

问题的根源是 Notes 不显示 HTML*。为了显示 HTML 格式的 MIME 电子邮件(或内容存储为 MIME 和 HTML 的任何其他富文本字段),必须首先将内容转换为 Notes Rich Text(复合数据或 CD)格式。静态HTML的转换多年来已经改进了很多,但是一旦转换完成,就没有HTML文档可以修改。显然,您的链接/操作已正确转换为其 Notes 等效项,但 Notes 客户端中没有 DOM 方法的挂钩。 JavaScript 几乎仅限于操作字段值(通过 document.forms[0].LiteralFieldName 访问方法)、交换图像(通过 document.images 集合)以及窗口对象方法的一小部分。

*人们可以在 Notes 客户端中查看纯网页,但它在完整选项卡中使用 IE ActiveX 控件 - 它本身无法用于呈现文档的一部分。

The root of the problem is that Notes doesn't display HTML*. In order to display an HTML-formatted MIME email (or any other rich text field whose contents are stored as MIME and HTML), the content must first be converted to Notes Rich Text (composite data, or CD) format. The conversion of static HTML has improved a lot over the years, but once the conversion is completed, there is no HTML document to modify. Obviously, your link/action was properly translated to its Notes equivalent, but there are no hooks for DOM methods in the Notes client. JavaScript is pretty much restricted to manipulating field values (through the document.forms[0].LiteralFieldName method of access), swapping images (through the document.images collection) and a small subset of the window object's methods.

*One can view pure web pages in the Notes client, but that uses the IE ActiveX control in the full tab -- it's not available natively for rendering a part of a document.

爱你不解释 2024-10-07 21:51:54

它可能不适合您的 HTML 需求,但可能会帮助您隐藏/显示内容:

  • 在新邮件中,选择要隐藏/显示的内容
  • 单击“创建/部分”
  • 您还可以在部分属性中为此部分定义名称

(适用于莲花笔记 8.5)

it may not fit your HTML needs but might help you hide / show content:

  • In a new mail, select the content you want to hide / show
  • Click on Create / Section
  • You can also define a name for this section within section's properties

(works in Lotus Notes 8.5)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文