qq在線客服代碼以及js操作剪貼板代碼[支持 IE firefox] |
網(wǎng)站在線客服系統(tǒng) 1263202635 作者:劉晴 來源: 文字大小:[大][中][小] |
代碼: <html> <body> <div> <a href="tencent://Message/?Uin=791748668&websiteName=www.wibowibo.com&Menu=yes"><img border="0" SRC="http://wpa.qq.com/pa?p=1:791748668:14" alt="點(diǎn)擊跟客戶交談"></a> <a href="http://wpa.qq.com/msgrd?V=1&Uin=304275958&Site=a-hai.net&Menu=yes"> <img border="0" SRC='http://wpa.qq.com/pa?p=1:304275958:3' alt="聯(lián)系客服"></a> <a href="http://wpa.qq.com/msgrd?V=1&Uin=791748668&Site=a-hai.net&Menu=yes"> <img border="0" SRC='http://wpa.qq.com/pa?p=1:791748668:3' alt="聯(lián)系客服"></a> <a href="http://sighttp.qq.com/cgi-bin/check? sigkey=e33844527909a0bf5905ce8c59aa4e0d46ede9b2d545e4aa8e17397c52bfcc0dd44882f22fdfbc8c93430 91031d09446"; target=_blank; onclick="var tempSrc='http://sighttp.qq.com/wpa.js? rantime='+Math.random() +'&sigkey=e33844527909a0bf5905ce8c59aa4e0d46ede9b2d545e4aa8e17397c52bfcc0dd44882f22fdfbc8c93 43091031d09446';var oldscript=document.getElementById('testJs');var newscript=document.createElement('script');newscript.setAttribute('type','text/javascript'); newscript.setAttribute('id', 'testJs');newscript.setAttribute('src',tempSrc);if(oldscript == null){document.body.appendChild(newscript);}else{oldscript.parentNode.replaceChild (newscript, oldscript);}return false;"><img border="0" SRC='http://wpa.qq.com/pa? p=1:304275958:3' alt="聯(lián)系客服"></a> </div> <script> function copyToClipboard() { var d=document.all("source").value; copyToClipboardAll(d); } function copyToClipboardAll(txt) { if (window.clipboardData) { window.clipboardData.clearData(); window.clipboardData.setData("Text", txt); } else if (navigator.userAgent.indexOf("Opera") != -1) { window.location = txt; } else if (window.netscape) { try { netscape.security.PrivilegeManager .enablePrivilege("UniversalXPConnect"); } catch (e) { alert("你使用的FireFox瀏覽器,復(fù)制功能被瀏覽器拒絕!\n請(qǐng)?jiān)跒g覽器地址欄輸入 “about:config”并回車。\n然后將“signed.applets.codebase_principal_support”雙擊,設(shè)置為 “true”"); return; } var clip = Components.classes['@mozilla.org/widget/clipboard;1'] .createInstance(Components.interfaces.nsIClipboard); if (!clip) return; var trans = Components.classes['@mozilla.org/widget/transferable;1'] .createInstance(Components.interfaces.nsITransferable); if (!trans) return; trans.addDataFlavor('text/unicode'); var str = new Object(); var len = new Object(); var str = Components.classes["@mozilla.org/supports-string;1"] .createInstance(Components.interfaces.nsISupportsString); var copytext = txt; str.data = copytext; trans.setTransferData("text/unicode", str, copytext.length * 2); var clipid = Components.interfaces.nsIClipboard; if (!clip) return false; clip.setData(trans, null, clipid.kGlobalClipboard); } } </script> <BODY > <button onclick="copyToClipboard();">拷貝</button> <input type="text" size=20 id="source" value="測(cè)試數(shù)據(jù)"> <br> <button onclick="alert(window.clipboardData.getData('text'));">顯示</button> <button onclick="window.clipboardData.clearData('text');">清空</button> </body> </html> |