var reg = new RegExp($(this).val() + "/","gi");
order = order.replace(reg,"");
블로그 이미지

디츠

“말은 쉽지, 코드를 보여줘.” “Talk is cheap. Show me the code.” – 리누스 토르발스(Linus Torvalds)

,

Korean.json
다운로드

 $("#list").DataTable({
	"bFilter": false, // search 필터
	"bLengthChange": false, // 목록갯수 on/off
	"iDisplayLength": 5, // 목록갯수
	"aLengthMenu": [ [1, 2, 3, 4, 5 ], [1, 2, 3, 4, 5] ] // 갯수선택
	"searching": false, // 서치박스
	"paging": false, // 페이징
	"ordering": false, // 정렬
	"info": false // 정보
	"columnDefs": [{
		"targets": [ 0 ],
		"visible": false,
		"searchable": false,
		"orderable": false
		},
		"sDom": '<lf<t>ip>'
		"language": { // 언어팩
		"url": "//cdn.datatables.net/plug-ins/1.10.9/i18n/Korean.json"
		}]
 });

table.column(1).search($(this).val()).draw();
언어 - https://www.datatables.net/plug-ins/i18n/

 

날짜검색 - http://i5on9i.blogspot.kr/2014/09/datatables-date-filter-add-on.html
블로그 이미지

디츠

“말은 쉽지, 코드를 보여줘.” “Talk is cheap. Show me the code.” – 리누스 토르발스(Linus Torvalds)

,
window.open('about:blank','_self').self.close();

'javascript, jquery' 카테고리의 다른 글

str.replace 문자열 정규식 변경  (0) 2015.11.19
datatable 플러그인 사용법  (0) 2015.11.05
마우스 따라다니는 메뉴  (0) 2015.10.01
창 크기에 맞게 리사이징  (0) 2015.09.25
jquery - ajax 파일 업로드  (0) 2015.09.19
블로그 이미지

디츠

“말은 쉽지, 코드를 보여줘.” “Talk is cheap. Show me the code.” – 리누스 토르발스(Linus Torvalds)

,
function ping($host, $port=80, $timeout=6) {
	$fsock = fsockopen($host, $port, $errno, $errstr, $timeout);
	if (!$fsock) {
		return FALSE;
	} else {
		fclose($fsock);
		return TRUE;
	}
}
출처 : http://www.cikorea.net/tip/view/2002/page/1/
블로그 이미지

디츠

“말은 쉽지, 코드를 보여줘.” “Talk is cheap. Show me the code.” – 리누스 토르발스(Linus Torvalds)

,
<style type="text/css">
	#scroll {position:fixed; width:60px; height:20px; right:50px; bottom:50px; display:none; } 
</style>

<script>
$(document).scroll(function() {
	var top = $("#scroll");
	var position = $(window).scrollTop();
  	var height = $(document).height();
	var bottom = height - position;
    
	if(bottom < 1500) {
		top.fadeOut(500);
	} else if(position > 250) {
		top.fadeIn(500);
	} else if(position < 250) {
		top.fadeOut(500);
	}
 });

$("#scroll").click(function() {
	$("html,body").animate({ scrollTop: 0 }, 500);
});
</script>

<span id="scroll">처음으로</span>
블로그 이미지

디츠

“말은 쉽지, 코드를 보여줘.” “Talk is cheap. Show me the code.” – 리누스 토르발스(Linus Torvalds)

,
(function($) {
    $(function () {
        $(window).load(function () {
            popupAutoResize(); //팝업리사이징
        });
    });
 
    function popupAutoResize() { //팝업리사이징
        var w = $('body > div > div').innerWidth();
        var h = $('body > div > div').innerHeight();
        //window.resizeTo(w, h);
 
        var mw = window.outerWidth - window.innerWidth;
        var mh = window.outerHeight - window.innerHeight;
        
  // window.resizeBy(mw, mh);
        window.resizeTo(w + mw, h + mh);
        if (msieversion() < 9 && msieversion() != 0) {
            mw = $(document).outerWidth() - $(window).width();
            mh = $(document).outerHeight() - $(window).height();
            window.resizeBy(mw, mh);
        }
    }
    function msieversion() { // 익스버전체크
        var ua = window.navigator.userAgent
        var msie = ua.indexOf ( "MSIE " )
        if ( msie > 0 ) // If Internet Explorer, return version number
            return parseInt (ua.substring (msie+5, ua.indexOf (".", msie )))
        else // If another browser, return 0
            return 0
    }
 
})(jQuery);
블로그 이미지

디츠

“말은 쉽지, 코드를 보여줘.” “Talk is cheap. Show me the code.” – 리누스 토르발스(Linus Torvalds)

,