본문 바로가기

Javascript

document.documentElement.innerHTML 오랜만에 이전에 배운 책을 뒤적이다가 발견했다. 쓸일이 없어서 기억도 안나는... document.documentElement 는 문서의 를 나타내는 자바스크립트이다. 그래서 뒤에 innerHTML이 오므로 html 전체 소스를 나타내겠다. 처음에 이걸로 신기해서 많이 했던게 javascript:alert(document.documentElement.innerHTML); 이거다. 사이트에 들어가서 누르면 소스가 보인다. 그리고 페이지를 만들어 소스를 찍었던거 같다. 초심일 때 정말 좋았다. 지금은 이거 보고 코웃음이 먼저 나왔다. 초심으로 돌아가자. 더보기
smart GWT 설치 for Eclipse Indigo 이클립스 인디고에 smart GWT를 설치해 보았다. Help > Install New Software에 다음 URL을 추가하자. 참고로 뒤에 3.7은 이클립스 버젼이다. 3.6은 헬리오스~ gwt Designer http://dl.google.com/eclipse/plugin/3.7 또는 아래 gwt Designer 사이트에서 확인 http://code.google.com/intl/ko-KR/webtoolkit/tools/download-gwtdesigner.html smart GWT는 여기 http://code.google.com/p/smartgwt/downloads/detail?name=smartgwt-2.5.zip 설치는 잘 진행된다. 참고로 안드로이드는 체크하지 말자. 해도 안된다. 소스를 찾지.. 더보기
img 태그 엑박 방지하기 html 이벤트중에 onError를 이용하면 엑박을 방지할 수 있다. onError는 윈도우나 이미지등 개체의 읽기 오류가 발생되면 이벤트 발생 [출처] window.onerror 이벤트 - 윈도우나 이미지등 개체의 읽기 오류가 발생되면 이벤트 발생|작성자 밍밍 한다. 위처럼 사용하면 이미지를 찾지 못할 경우 대체할 이미지로 화면에 뿌려주게 된다. jQuery로도 가능하다. $().ready(function(){ $('img).each(function(n){ $(this).error(function(){ $(this).attr('src', '대체할 이미지'); }); }); }); 간단한듯하나 테스트해보지 못했다. 원본 페이지: http://anyx.tistory.com/130 더보기
RSS 파싱해보자(test 중) var arrTitle = new Array(), arrDesc = new Array(), arrLink = new Array();function loadXML(url, handler) {if (document.implementation && document.implementation.createDocument) {var xmldoc = document.implementation.createDocument("", "", null);xmldoc.onload = function( ) { handler(xmldoc); }xmldoc.load(url);}else if (window.ActiveXObject) { var xmldoc = new ActiveXObject("Microsoft... 더보기
스마트폰 터치 테스트 아래 테이블 위를 터치해보세요. 스마트폰이나 테블릿만 ^^ touchstartX touchstartY touchmoveX touchmoveY touch staus 소스코드 touchstartX touchstartY touchmoveX touchmoveY touch staus 더보기