Skip to content

$.copy()

Arthur Guiot edited this page Aug 23, 2017 · 1 revision

How does it works?

This function is simply made to help you copy something to the clipboard (without having the user pressing Ctrl+C on Windows and ⌘C Simply input a String in this function and it will automatically copied to the clipboard, if the Browser supports it.

If it doesn't, DisplayJS will show up a window.prompt that will ask the user to select the text and press Ctrl+C.

How to use it?

Example

$.then(function {
    $.copy("DisplayJS is the best JavaScript framework ever!");
}, function {
    alert("Text copied!")
});
Clone this wiki locally