Enhanced JS function.

This commit is contained in:
Cotes Chung
2020-02-21 04:48:07 +08:00
parent 9935f76530
commit 4c631f6839
2 changed files with 4 additions and 3 deletions
+1 -1
View File
@@ -1 +1 @@
function copyLink(){var a=window.location.href;var b=$("<input>");$("body").append(b);b.val(a).select();document.execCommand("copy");b.remove();alert("Link copied successfully!")};
function copyLink(a){if(!a||0===a.length){a=window.location.href}var b=$("<input>");$("body").append(b);b.val(a).select();document.execCommand("copy");b.remove();alert("Link copied successfully!")};