웹프로그래밍/Javascript (26) 썸네일형 리스트형 Javascript contains domain or email by string var url_regex = /(http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w-.\/?%&=]*)?)/gi; var email_regex = /([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9._-]+)/gi; var string = "도메인은 http://www.huzy.net/ 이고 이메일은 root@yjhoon.com 입니다."; var url_result = string.match(url_regex); => ["http://www.huzy.net/"] var email_result = string.match(email_regex); => [root@yjhoon.com"] result 값은 둘다 배열로 리턴되서 나옴 . How to unset a JavaScript variable? I know this is an old thread, but the selected answer isn't clear enough for me. The point is the delete operator removes a property from an object. It cannot remove a variable. So the answer to the question depends on how the global variable or property is defined. (1) If it is created with var, it cannot be deleted. For example:var g_a = 1; //create with var, g_a is a variable delete g_a; //re.. [jQuery] .each $.each 순회중 continue, break 하기 jQuery에서 for, while 문과 비슷한 역할을 하는 each 메소드 사용 시 break, continue와 같은 프로세스를 수행해야 할 때가 있다. 그럴 때 return true;는 continue와 같은 역할을, return false;는 break와 같은 역할을 수행한다. 예제 >> $('#loop').each ( function() { if ( i==0 ) return true; // continue; else return false; // break; } ); 출처 :http://dhplanner.blogspot.kr/2009/06/jquery-each-%EB%A9%94%EC%86%8C%EB%93%9C-%EC%82%AC%EC%9A%A9%EC%8B%9C-break-continue-%EC%8.. 밴드(BAND) 공유하기 정보(제목/내용/이미지) 스니핏 밴드 공유하기를 구현할때, 제목 내용 이미지를 넣고 싶었지만 아무리 공유하기를 눌러도 전달되지 않았다. window.open("http://www.band.us/plugin/share?body="+encodeURIComponent($("#docTitle").val() + "-" + $("#docAuthor").val())+encodeURIComponent("\n")+encodeURIComponent($("#docShortUrl").val())+"&route="+location.href, "share_band", "width=410, height=540, resizable=no"); (JSTL구문이 섞여있다...) 어쨋거나 body 파라미터에 제목\n주소 식으로 전달을 하면 밴드에 공유하기에 카드가 생긴다.. jQuery DatePicker 버튼 만들기 (동적 생성) 위와같이 할 경우 datepicker input 옆에 버튼이 생성된다. 이 버튼의 class는 ui-datepicker-trigger 를 가지므로 스타일시트에서 자신의 기호에 맞게 이미지를 배경으로 깔든 편하게 쓰면 된다. javascript comma and uncomma 자바스크립트에서 숫자를 표기할때 3자리마다 콤마를 찍어줘야 할 때가 있다 자주 사용하는 기능인데 매번 만들기란 여간 귀찮은게 아니다. 콤마찍기 1 2 3 4 5 //콤마찍기 function comma(str) { str = String(str); return str.replace(/(\d)(?=(?:\d{3})+(?!\d))/g, '$1,'); } 콤마풀기 1 2 3 4 5 //콤마풀기 function uncomma(str) { str = String(str); return str.replace(/[^\d]+/g, ''); } 복사 붙여넣기로 사용하자! input box에서 사용자 입력시 바로 콤마를 찍어주기 위한 함수도 추가 한다. 1 2 3 4 5 function inputNumberFormat(ob.. Solve “Invalid App Id: Must be a number or numeric string representing the application id” 페이스북 developer 에서 app을 새로 생성하면 주는 key를 입력해주면 된다. You wanted to have Facebook Like Button or Facebook Like Box and other Facebook social plugins on your website. You copy pasted to code Facebook generated for you on your web pages. If you do not have an App ID when you copied this, chances are the Facebook script will complain in your Web Browser’s console (e.g Firebug Console). Invalid App Id: M.. 지정된 영역만 인쇄하기 [첫 번째 영역] 첫 번째 영역입니다! [두 번째 영역] 두 번째 영역입니다! [세 번째 영역] 세 번째 영역입니다! [출처] http://blog.naver.com/masca727/60038165332 이전 1 2 3 4 다음