用JavaScript复制到剪贴板 [英] Copy to clipboard in JavaScript

查看:80
本文介绍了用JavaScript复制到剪贴板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法通过JavaScript改变用户的剪贴板?

Is there a way at all of altering the clipboard of the user via JavaScript?

我希望他们点击地图上的给定点,然后添加该位置到其剪贴板的坐标。

I want it that they click a given point on a map, and it adds the coordinates of the position to their clipboard.

但我确实认为这不可能实现。

I do however assume that this is not possible for JavaScript to achieve.

推荐答案

您可以尝试使用 zeroclipboard 库,包括在页面上放置一个不可见的flash元素,以便将文本的实际副本复制到剪贴板。

You could try using the zeroclipboard library, which involves placing an invisible flash element on the page to do the actual copy of text to the clipboard.

这篇关于用JavaScript复制到剪贴板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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