为什么github上复制链接的那个按钮用的flash?


图片描述

右边的那个复制的按钮是个flash,为什么呢?

flash JavaScript

两边都看不见啦 9 years, 8 months ago

主要是兼容性问题吧,虽然有些浏览器提供了复制的API,但是并不通用

某终焉D风灵 answered 9 years, 8 months ago

Ubuntu上Chromium没装flash,果断没有复制按钮。。

天欲雪TYX answered 9 years, 8 months ago

图片描述

只是一个font icon啊


不好意思,是我自己没看清楚,是有用到 flash @llffzzk 说的对,github用的是这个插件: zeroclipboard

This library is fully compatible with Flash Player 11.0.0 and above,
which requires that the clipboard copy operation be initiated by a
user click event inside the Flash movie. This is achieved by
automatically floating the invisible movie on top of a DOM element of
your choice. Standard mouse events are even propagated out to your DOM
element, so you can still have rollover and mousedown effects with
just a little extra effort.

未来会怎样1 answered 9 years, 8 months ago

出于安全考虑,默认浏览器不能访问剪切板,需要开启才行,但是不是所有人都知道都会这么做,所以用了flash解决这个问题,flash可以访问

航海♂日志 answered 9 years, 8 months ago

解决浏览器兼容性问题

宫本赤南介丶 answered 9 years, 8 months ago

Your Answer