Get the App
SLTechnology News&Howtos  ›  Network Security  › 

Js is perfectly compatible with the copy function of the browser.

Shulou Source: shulou.com Published: 2022-06-01 05:24:36 10月04日 Update

1js combined with swf copy function, perfectly compatible with Firefox, Google, 360 Personality IE8, use example: (ps: it is more important to introduce copy.swf, File Portal decompression password: http://www.bieanju.com/, in order to prevent 360 from deleting files, please remove the suffix 1 after decompression)

Function copyText () {var clip = new ZeroClipboard.Client (); clip.setHandCursor (true); / / var text= document.getElementById ('tgurl'). Value; var text= $(' input [name = "tgurl"]'). Val (); clip.setText (text); clip.glue ("copyurl") Clip.addEventListener ("complete", function () {alert ("copy successful!") ;})

2. The following is the source code of copy.js:

Var ZeroClipboard = {version: "1.0.7", clients: {}, / / registered upload clients on page, indexed by id moviePath:'. / js/copy.swf', / / URL to movie nextId: 1, / / ID of next movie $: function (thingy) {/ / simple DOM lookup utility function if (typeof (thingy) = = 'string') thingy = document.getElementById (thingy) If (! thingy.addClass) {/ / extend element with a few useful methods thingy.hide = function () {this.style.display = 'none';}; thingy.show = function () {this.style.display =';}; thingy.addClass = function (name) {this.removeClass (name); this.className + =''+ name;} Thingy.removeClass = function (name) {var classes = this.className.split (/ / var idx /); var idx =-1; for (var k = 0; k

< classes.length; k++) { if (classes[k] == name) { idx = k; k = classes.length; } } if (idx >

Tags: File feature important success suffix password source code Firefox example i.e. browser browsing Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB Xiaomi Microsoft Huawei Shulou Information