자바스크립트
-
트위터, 페이스북, 미투데이에 글을 보낼 수 있는 자바스크립트개발 2011. 6. 8. 09:59
function twitter(url,msg) { var href = "http://twitter.com/home?status=" + encodeURIComponent(msg) + " " + encodeURIComponent(url); var a = window.open(href, 'twitter', ''); if ( a ) { a.focus(); } return false; } function facebook(url,msg) { var href = "http://www.facebook.com/sharer.php?u=" + url + "&t=" + encodeURIComponent(msg); var a = window.open(href, 'facebook', ''); if ( a ) { a.focus()..
-
배너 스크립트개발 2011. 4. 8. 14:25
var bPOut = '', bIndex = 0, bPSpeed = 5000;var bPList = new Array();bPList.push(['popup0330.jpg', '/not_0102000000.jsp?type=view&b_idx=12466', '', '부설연구소장초빙']);bPList.push(['sosicpopup.jpg', '/web/web_0104000000.jsp', '', '소식지 신청']);bPList.push(['popup0324.jpg', ' /kem_home/info/news/notice/kem_view.asp?q=16528', '_blank', '에너지절약 아이디어 공모전']);bPList.push(['popup1115.jpg', ' /not/not_010200..
-
클래스 이름을 사용하여 요소찾기개발 2010. 6. 2. 13:43
html 에서 아이디 또는 태그이름으로 구성 요소를 찾을 수 있다. getElementById(); getElementsByTagName(); 그러면 클래스 이름으로 요소를 찾을 수 있지 않을까? 검색해보니 getElementsByTagName() 함수가 존재한다. 그런데 파이어폭스 3.6에서는 잘 되지만 IE7.0에서는 이 함수가 존재하지 않는다. (혹시 다른 이름으로 존재할지 모르지) 그래서 사용자 정의 함수로 만들어 보자. function getElementsByClass(searchClass, node, tag) { var classElements = new Array(); if ( node == null ) node = document; if ( tag == null ) tag = '*'; va..