How to copy IE browser
Example 1
The code is as follows |
Copy Code |
Text Copy CopyText = function (str) { if (Browerkernel.isie ()) { Clipboarddata.setdata (' Text ', str); Alert ("Site link has been copied to your Pasteboard" n you can use Ctrl + V paste); }else{ Prompt ("Your browser does not support automatic replication, please press CTRL + C manually copy:", str); } }; |
Example 2
Click the Copy button code:
The code is as follows |
Copy Code |
<script language=javascript> <!-- function Mm_gotourl () {//v3.0 var i, args=mm_gotourl.arguments; Document. Mm_returnvalue = false; For (i=0 i< (args.length-1); i+=2) eval (args[i]+ ". location= '" "+args[i+1]+" "); } function JM_CC (ob) { var obj=mm_findobj (OB); if (obj) { Obj.select (); Js=obj.createtextrange (); Js.execcommand ("Copy");} } function Mm_findobj (n, D) {//v4.0 var p,i,x; if (!d) d=document; if ((P=n.indexof ("?")) >0&&parent.frames.length) { D=parent.frames[n.substring (p+1)].document; N=n.substring (0,p);} if (!) ( X=d[n]) &&d.all) x=d.all[n]; for (i=0;! x&&i<d.forms.length;i++) X=d.forms[i][n]; for (i=0;! x&&d.layers&&i<d.layers.length;i++) X=mm_findobj (n,d.layers[i].document); if (!x && document.getElementById) X=document.getelementbyid (n); return x; } --> </SCRIPT> <input Name=button onclick= "jm_cc (' Js_1 ')" Type=button value= copy to Clipboard > <BR> <form action= "" Method=post name=form1> <div align= "center" > <textarea cols=70 name=js_1 rows=10 wrap=virtual> content to replicate </textarea> </div> </form> |
Example 3
The code is as follows |
Copy Code |
(function () { window[' Util '] = { cache:{}, Gettext:function () { return Util.CACHE.CLIPBOARD_TEXT; }, Successhide:function () { Alert ("Copy the North Sea 365 network recruitment email address!"); }, Copy:function (Pstr,hasreturn, ISDO) { var html = []; Html.push (' <object type= ' Application/x-shockwave-flash "Data=" clipboard.swf?gettext=util.gettext&success= Util.successhide "width=" "height=" "style=" position:relative;top:11px;left:-50px; "id=" ff_clipboard_swf ">" ); Html.push (' <param name= "quality" value= "High"/> "); Html.push (' <param name= "allowscriptaccess" value= "Samedomain"/> "); Html.push (' <param name= "allowfullscreen" value= "true"/> "); Html.push (' <param name= "wmode" value= "Transparent"/> "); Html.push (' </object> '); var Yu=document.getelementbyid (' Copy '). InnerHTML; document.getElementById (' Copy '). Innerhtml=yu+html.join ('); Util.CACHE.CLIPBOARD_TEXT = pstr; } } Util.copy (' zhaopin@beihai365.com '); })(); If you want to be compatible with IE. You also have to add Copy code code as follows: if (window.clipboarddata) { Window.clipboardData.setData ("Text", pstr); Util.successhide (); } |