Posted
Filed under Htm&Javascript

jQuery(document).ready(function () {
    var minDate = new Date();
    var maxDate = new Date();
    var dd = maxDate.getDate() + 7;
    maxDate.setDate(dd);

    jQuery("#startDate").datepicker({
        minDate : minDate,
        maxDate : maxDate
    });
});


===================================================
옵션 형태로 추가하는 경우

jQuery(document).ready(function () {
    var minDate = new Date();

    jQuery("#startDate").datepicker("option", "minDate", minDate);
});

2017/12/15 17:06 2017/12/15 17:06

blog.visualp.com

blog.visualp.com

blog.visualp.com

blog.visualp.com

blog.visualp.com

Posted
Filed under Htm&Javascript
<table id="test" />
<button type="button" onclick="tableToExcel('test')" />

페이징이 없는 테이블 데이터를 받을 때 쓸만합니다.
한글 처리 핵심은 %EF%BB%BF


function
tableToExcel(id) {
    var data_type = 'data:application/vnd.ms-excel;charset=utf-8';
    var table_html = encodeURIComponent(document.getElementById(id).outerHTML);
 
    var a = document.createElement('a');
    a.href = data_type + ',%EF%BB%BF' + table_html;
    a.download = id+'_excel'+'.xls';
    a.click();
}
[참조]https://phpschool.com/gnuboard4/bbs/board.php?bo_table=tipntech&wr_id=81515
2017/07/27 08:58 2017/07/27 08:58
Posted
Filed under Htm&Javascript

$(document).ready(function() {

$(".telnumber").keyup(function(){

$(this).val($(this).val().replace(/[^0-9]/g,""));

});

$(".name").keyup(function(){

$(this).val($(this).val().replace(/[^\!-z]/g,""));

});

});

2015/10/09 21:22 2015/10/09 21:22
Posted
Filed under Htm&Javascript

<?php $thour=17 ?>
<script>
 
var dateObj = new Date();
var month = dateObj.getUTCMonth() + 1; //months from 1-12
var day  = dateObj.getUTCDate();
var year = dateObj.getUTCFullYear();
var hour = dateObj.getHours();
var minute = dateObj.getMinutes();
var second = dateObj.getSeconds();

//var end = new Date('13 Apr 2016 13:30:00');
var end  = new Date(year,month-1,day,<?php echo $thour?>,0,0 );

var _second = 1000;
var _minute = _second * 60;
var _hour = _minute * 60;
var _day = _hour *24;
var timer;

function showRemaining()
{
    var now = new Date();
    var distance = end - now;
    if (distance < 0 ) {
       // handle expiry here..
    clearInterval( timer ); // stop the timer from continuing ..
    location.reload();
  
       //alert('Expired'); // alert a message that the timer has expired..
    }
    var days = Math.floor(distance / _day);
    var hours = Math.floor( (distance % _day ) / _hour );
    var minutes = Math.floor( (distance % _hour) / _minute );
    var seconds = Math.floor( (distance % _minute) / _second );
    var milliseconds = parseInt(distance % _second /10);

/*
    var countdownElement = document.getElementById('timer');
 
 countdownElement.innerHTML = days  + 'd ' +
                                 hours + 'h ' +
                                 minutes + 'm ' +
                                 seconds + 's ' +
                                 milliseconds + 'ms';
*/
 
 if(hours<10){
  hours = "0" + hours;
 }
 if(minutes<10){
  minutes = "0" + minutes;
 }
 if(seconds<10){
  seconds = "0" + seconds;
 }
 
 if(milliseconds<10){
  milliseconds = "0"+milliseconds;
 }

 var thour = document.getElementById('thour');
 var tminute = document.getElementById('tminute');
 var tsecond = document.getElementById('tsecond');
 var tms = document.getElementById('tms');
 
 thour.innerHTML = hours;
 tminute.innerHTML=minutes;
 tsecond.innerHTML=seconds;
 tms.innerHTML=milliseconds;
 
}

timer = setInterval(showRemaining, 10);

</script>


<div id="timer">
 <span id="thour"></span>
 <span class="sp">:</span>
 <span id="tminute"></span>
 <span class="sp">:</span>
 <span id="tsecond"></span>
 <span class="sp">:</span>
 <span id="tms"></span>
</div>

2015/06/15 15:36 2015/06/15 15:36
Posted
Filed under Htm&Javascript

delimiter $$
create trigger update_check BEFORE UPDATE on tb_list FOR EACH ROW
BEGIN
 
 IF NEW.tname <> OLD.tname THEN
           SET NEW.tname = OLD.tname;
 END IF;
END$$

delimiter ;

2015/03/31 23:08 2015/03/31 23:08
Posted
Filed under Htm&Javascript

[원문]http://stackoverflow.com/questions/1649086/detect-rotation-of-android-phone-in-the-browser-with-javascript
[설명] 크롬 <-- 안드로이드 에서 모바일 환경에서 핸드폰 회전할 때  width 값을  구할 수 있는 스크립트


var isMobile = {
    Android: function() {
        return /Android/i.test(navigator.userAgent);
    },
    iOS: function() {
        return /iPhone|iPad|iPod/i.test(navigator.userAgent);
    }
};
if(isMobile.Android())
    {
        var previousWidth=$(window).width();
        $(window).on({
        resize: function(e) {
        var YourFunction=(function(){

            var screenWidth=$(window).width();
            if(previousWidth!=screenWidth)
            {
                previousWidth=screenWidth;
                alert("oreientation changed");
            }

        })();

        }
    });

    }
    else//mainly for ios
    {
        $(window).on({
            orientationchange: function(e) {
               alert("orientation changed");
            }  
        });
    }

2015/03/26 10:11 2015/03/26 10:11
Posted
Filed under Htm&Javascript
말풍선 툴팁 (모든브라우져 사용가능) 툴팁 링크 tooltip 툴팁 링크 툴팁내용 미리보기 : http://finalee99.cafe24.com/sos/bubble01.html
2014/08/01 15:25 2014/08/01 15:25
Posted
Filed under Htm&Javascript
다음과 같이 메타 테그를 넣어 준다.

<meta http-equiv="X-UA-Compatible" content="IE=Edge"/>
2014/03/19 14:17 2014/03/19 14:17
Posted
Filed under Htm&Javascript
<iframe id="contentFrame" name="contentFrame" src="about:blank" marginwidth="0" marginheight="0" frameborder="0" width="100%" height="100%" scrolling="no"></iframe>

<div id="content">
... contents ...
</div>
...
<script type="text/javascript">
function init(){
  var doc = document.getElementById('content');
  if(doc.offsetHeight == 0){
  } else {
  pageheight = doc.offsetHeight;
  parent.document.getElementById("contentFrame").height = pageheight+"px";
  }
}
window.onload = function(){
  init();
}
</script>
2013/11/28 16:20 2013/11/28 16:20