다음과 같이 코드 코드를 복사하십시오.
함수 copyText () {
// 컨텐츠를 복사합니다
var txt = document.getElementById ( "table2") [1] .Cells [0].
// 공간을 제거합니다
txt = txt.replace (//, "");
// 은행을 제거합니다
txt = txt.replace (/<br> <br>/, "");
if (window.clipboardData) {
Window.clipboardData.clearData ();
Window.clipboardData.SetData ( "Text", TXT);
Alert ( "커팅 보드에 성공적으로 복사되었습니다!");
} else if (navigator.useragent.indexof ( "opera")! = -1) {
Window.location = txt;
} else if (window.netscape) {
노력하다 {
netscape.security.privilegemanager.enableprivilege ( "Universalxpconnect");
} catch (e) {
ALERT ( ""브라우저에 의해 거부 된!/n, 브라우저 주소 표시 줄에 'about : config'를 입력 한 다음 Enter/n을 누른 다음 'signed.applets.codebase_princport'를 'true'로 설정하십시오. ");
}
var clip = components.classes ['@mozilla.org/widget/clipboard; 1 '] .CreateInstance (components.interfaces.nsiclipboard);
if (! clip) 반환;
var trans = components.classes [ '@mozilla.org/위젯/전송 가능;
if (! trans) 반환;
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 = 카피 텍스트;
trans.settransferdata ( "Text/Unicode", str, copyText.length * 2);
var clipid = components.interfaces.nsiclipboard;
if (! clip) false를 반환합니다.
clip.setData (trans, null, clipid.kglobalclipboard);
Alert ( "커팅 보드에 성공적으로 복사되었습니다!");
}
}