Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

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

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)06/01 Report--

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 >

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report