클립보드 (2) 썸네일형 리스트형 Javascript) http에서 클립보드 쓰기 기능 사용하기 클립보드에 내용을 저장하려고 할 때 사용하는 navigator.clipboard는 보안상의 이슈로 인해 https에서만 사용 가능한 객체다. 그때 야매로 사용할 수 있는 방법 ! var dataToClicpboard = "클립보드에 저장할 내용" let textArea = document.createElement("textarea"); textArea.value = dataToClicpboard; textArea.style.display = "fixed"; textArea.style.left = "-999999px"; textArea.style.top = "-999999px"; document.body.appendChild(textArea); textArea.focus(); textArea.select(.. React) textarea에 있는 값 클립보드에 복사하는 기능 만들기 import React from 'react'; import FileCopyIcon from '@material-ui/icons/FileCopy'; import { Tooltip, IconButton } from '@material-ui/core'; export default function Example({ resultText }) { const handleClickCopy = (resultJson) => { if (!document.queryCommandSupported("copy")) { return alert("복사하기가 지원되지 않는 브라우저입니다."); } const textarea = document.createElement("textarea"); textarea.value = JSON.st.. 이전 1 다음