function copyText() {
/ /콘텐츠 복사
var txt = document.getElementById("table2").rows[1].cells[0].innerHTML;
//공백 제거
txt = txt.replace(/ /," ");
//줄바꿈 제거
txt = txt.replace(/
/," ")if (window.clipboardData); {
window.clipboardData.clearData();
window.clipboardData.setData("Text", txt)
alert("클립보드에 성공적으로 복사되었습니다!"); .userAgent.indexOf("Opera") != -1) {
window.location = txt;
}else if (window.netscape) {
try {
netscape.security.PrivilegeManager. 활성화Privilege("UniversalXPConnect");
} catch (e) {
alert("브라우저에서 거부되었습니다!
브라우저 주소 표시줄에 'about:config'를 입력하고 Enter를 누르세요.
그런 다음 'signed.applets.codebase_principal_support'를 'true'로 설정합니다.");
}
varclip = 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(); 클래스["@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) return false;
clip.setData(trans, null, Clipid . kGlobalClipboard);
alert("클립보드에 성공적으로 복사되었습니다!")
}
}