아무생각없이 jquery의 편리함만 사용하고 있다가..
input type=file 에 대한 핸들링을 하다 아래의 내용을 확인함.
아래 내용은 테스트후 정리해볼것!
input type=file 에 대한 핸들링을 하다 아래의 내용을 확인함.
아래 내용은 테스트후 정리해볼것!
javascript select를 이용한 처리
1. 우선 선택을 해야된다.
document.getElementById("~").select();
2. 선택된것에 명령을 내린다.
document.execCommand("~", type1, type2);
- commend의 종류
: Paste
: Delete
: Copy
: Indent
: Outdent
: bold
: BackColor
: CreateLink
3. 기타
- input file 처리
: document.selection.createRange().text.toString(); -- 실 value값 불러오기 (IE8 보안문제 - fakepath)
: document.selection.empty();
: document.selection.clear(); -- 잘 안되는것 같음
jquery는 이 selection을 기준으로 셀렉트 연산자를 실행하는것 같다.
var SelText = window.getSelection();
document.getSelection();
document.selection.createRange().text;
SelText.type == "Text"..."None"
SelText.text;
SelText.htmlText;
SelText.pasteHTML("~~~~~~~~");
$(SelText).css("", "");
if (SelText.rangeCount && SelText.getRangeAt) {
range = SelText.getRangeAt(0);
}
SelText.removeAllRanges();
SelText.addRange(range);
'Front-Html > Javascript' 카테고리의 다른 글
모바일기기로 접속시 해당 url로 이동 처리 (1) | 2012.08.22 |
---|---|
javascript로 현재 url 분석 (2) | 2012.08.20 |
다음 Map Open API 설정 (5) | 2011.03.21 |
javascript php 문자열 관련 함수 비교 (2) | 2010.04.09 |
javascript 배열을 이용한 select box 2개 연결 (1) | 2010.04.09 |