본문 바로가기

반응형

웹프로그래밍

(130)
[Javascript] 페이지를 떠날 때 경고창 띄우기 다음과 같이 페이지를 벗어나기 전에, ‘수정사항이 있으니 다시 한번 확인해보세요’라는 메시지를 구현하는 방법에 대한 정리입니다. Javascript의 window.onBeforeUnload Event를 이용한 기능입니다. 실행시점 window.onBeforeUnload Event는 Window개체가 Unload되기 전에 실행됩니다. 정확하게 다음과 같은 시점이 있을 수 있습니다. 다만 IE 7, 8에서는 버그로 인해 다르게 동작하는 경우도 있으므로 참고가 필요합니다. 창이나 탭을 닫을 때 새로고침, 앞, 뒤로 이동버튼 클릭 시 location.href 변경 Form Submit 발생 시 A Tag 클릭 시 HREF에 URL을 지정한 경우: 발생 HREF에 #을 지정한 경우: 발생 안함 HREF에 java..
ios mobile 에서 터치시 background 색상 들어가는 문제 -webkit-tap-highlight-color: rgba(0,0,0,0); 출처: https://css-tricks.com/snippets/css/remove-gray-highlight-when-tapping-links-in-mobile-safari/
input number hide spin button 증가 감소 버튼 숨기기 input[type=number]::-webkit-outer-spin-button{-webkit-appearance: none;margin: 0;} input[type=number]::-webkit-inner-spin-button{-webkit-appearance: none;margin: 0;}
https 에서 한글 깨짐 현상(GET) 가 한 개가 아니라는걸 간과해서 protocol 이 HTTP/1.1 인 에만 설정을 하는 것입니다. 중에 protocol="HTTP/1.1" SSLEnabled="true" scheme="https" secure="true" clientAuth="false" sslProtocol="TLS" 등의 값이 포함된 다른 에도 URIEncoding 을 적어줘야 하고, mod_jk 을 통해서 처리하는 거라면 AJP/1.3 쪽 에서도 처리를 해야 합니다. https 443 Connector에 URIEncoding="UTF-8" 추가 후 해결,
PHP: Simple compression of JSON data Just discovered how super simple it was to add some gz compression when for example providing JSON data from PHP. All you need is regular output buffering with the ob_gzhandler as output callback. // Fetch some data $data = get_data(); // Turn on output buffering with the gzhandler ob_start('ob_gzhandler'); // Output as normal echo json_encode($data); The cool thing is that it actually looks at ..
javascript ios app open self.location / window. not working ios app 을 웹 어플리케이션에서 킬때... 사파리에서는 안먹히는 것 해결
jquery ui dialog close button missing jquery-ui 의 dialog close 버튼이 안보일때 bootstrap.min.js 와 스크립트 충돌로 인한것으로 해당 스크립트를 우선순위를 바꾸거나 제외하면 정상적으로 보인다.
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 값은 둘다 배열로 리턴되서 나옴 .

반응형