如何将链接的 html 源复制到剪贴板并解析为 Lotus Notes 中的链接?
如何将链接的 html 代码复制到剪贴板并将其解析为 Lotus Notes 中的链接?
例如,在 Javascript 中,将 StackOverFlow
放入剪贴板,然后将其解析为 Lotus Notes 中的链接,而写一封新电子邮件。它应该只在新消息中显示为 StackOverFlow 的链接。
我找到了一个函数window.clipboardData.setData("Text",link)
,但它只能将文本复制到剪贴板中。
有什么建议给我吗?
How do you copy the html code of a link to the clipboard and parse it as a link in Lotus Notes?
For example, in Javascript put <a href='http://www.stackoverflow.com'>StackOverFlow</a>
into clipboard, and then parse it as a link in Lotus Notes while writing a new email. It should only show a link as StackOverFlow in new message.
I found a function window.clipboardData.setData("Text",link)
, but it can only copy the text into clipboard.
Any tips for me?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
@Carlos 有基本的用户级方法来执行此操作,但似乎您想以编程方式执行此操作。我认为最有效的方法是执行诸如“粘贴链接”之类的操作:
此处的富文本字段 有关如何访问剪贴板的示例。
要将链接导入到笔记中,请根据您的操作构建一个基本的 HTML 文件,按照以下方式:
保存它,然后使用如下代码导入它:(
假设您将文件保存为“c:\foo.html”)。
根据您想要实现的具体目标以及您最满意的目标,您可能希望在 Notes 之外编写 HTML,然后仅让操作执行导入位。如果您采用这种方法,那么就不再需要使用剪贴板了。
请注意以下事项:
@Carlos has the basic user-level way to do it but it seems you want to do this programattically. I think the most effective approach is to have an action such as "paste link" that:
here's an example on how to get to the clipboard.
To import the link into notes, build a rudimentary HTML file from your action, along the lines of:
save it and then import it using code like:
(assuming you saved your file as "c:\foo.html").
Depending on what exactly you are trying to achieve and what you're most comfortable with, you may want to compose the HTML outside of Notes and just have the action do the import bit. If you take this approach then the need to play with the clipboard is gone.
Note the following:
window.clipboardData
是 Internet Explorer 独有的功能。其他浏览器供应商将干预剪贴板视为一种安全威胁,并且可能非常烦人,因此它没有在 Firefox 中实现。我知道跨浏览器执行此操作的唯一方法是使用 Flash 影片,您可以在此处找到更多相关信息:http://www.jeffothy.com/weblog/clipboard-copy/
如果您对仅支持 IE 感到满意,那么获取元素的完整外部 HTML 的方法 (不仅仅是innerHTML)将链接复制到另一个元素并获取那个元素的innerHTML。
javascript 看起来像这样(抱歉,它未经测试)
window.clipboardData
is an Internet Explorer only feature. Other browser vendors view meddling with the clipboard as a security threat and potentially really really annoying so it isn't implemented in Firefox, for example.The only way I know to do it cross-browser is to use a Flash movie, and you can find out more about that here: http://www.jeffothy.com/weblog/clipboard-copy/
If you're happy with supporting IE only, then the way to get the full outer HTML of an element (not just the innerHTML) would be to duplicate the link into another element and get the innerHTML of that element.
The javascript looks something like this (sorry, it's untested)
要在 Lotus Notes 电子邮件中创建链接,您必须:
这是用于 Notes 7. 不确定是 Notes 8 还是 8.0.2 在工具栏上添加了一个按钮以方便执行此操作。
希望这有帮助
To create a link in a Lotus Notes email you have to:
This is for Notes 7. Not sure if it was Notes 8 or 8.0.2 where they added a button on the toolbar to make it easy to do this.
Hope this helps