수학관련 함수
/** 소수검사 */ function chkPrime(n) { if(n == 1) {return false;}; for(i=2; i
- Javascript
- · 2009. 1. 8.
fieldset 그룹박스
Title Content TitleContent 항상 안에 존재 해야함. 항상 존재해야함 (display:none 으로 숨길수 있음)
- Javascript
- · 2008. 12. 26.
DOM 프로퍼티 attributes :현재 노드에 대한 속성 목록을 반환 parentNode :현재 노드의 부모노드 반환 기본구문: objParentNode = xmlDocumentNode.parentNode childNodes :현재 노드의 모든 하위노드 목록 반환 기본구문)objNodeList = node.childNodes[n] previousSibling : 현재 노드의 바로 이전 형제 노드 반환, 없으면 null 반환 nextSibling : 현재 노드의 바로 다음 형제 노드를 반환, 없으면 null 반환 nodeType : 주어진 노드에 대한 DOMtype 지정한다 기본구문)numNodeType = xmlDocNode.NodeType; Details)12가지의 정수값을반환한다 value ---..
onerror=handleErr function handleErr(msg,url,l) { var txt=""; txt="There was an error on this page.\n\n" txt+="Error: " + msg + "\n" txt+="URL: " + url + "\n" txt+="Line: " + l + "\n\n" omsg = $("errmsg"); if(typeof(omsg) == "object") { omsg = document.createElement("div"); document.body.insertBefore(omsg,document.body.childNodes[0]); omsg.id = "errmsg"; try{ omsg.setStyle({"padding":"5px","back..
/** 소수검사 */ function chkPrime(n) { if(n == 1) {return false;}; for(i=2; i
Title Content TitleContent 항상 안에 존재 해야함. 항상 존재해야함 (display:none 으로 숨길수 있음)
/** * 전화번호 */ function SetTelFormat(obj) { val = obj.value; if(val.length < 8) { obj.value = ""; obj.focus(); alert("올바른 전화번호를 입력하세요."); return false; } str = ""; for(i=0; i
//Trim function trim(val,optval) { if(optval == "compress") { val = val.replace(/\s+/g, ""); }else if(optval == "trim") { val= val.replace(/^\s+/, "").replace(/\s+$/, ""); }else if(optval == "rtrim") { val = val.replace(/\s+$/, ""); }else if(optval == "ltrim") { val = val.replace(/^\s+/, ""); }else { val= val.replace(/^\s+/, "").replace(/\s+$/, ""); } return val; }