ȸ¿ø°¡ÀԡžÆÀ̵ð/ºñ¹øã±â
ȨÀ¸·Î

ÀÚ¹Ù½ºÅ©¸³Æ® »ç¿ëÀÚ ÇÔ¼ö
16³â Àü
/*---------------------------------------------

* String ¹®ÀÚ ÀÚ¸£±â.
---------------------------------------------*/
String.prototype.cut = function(len) {
var str = this;
var l = 0;
for (var i=0; i<str.length; i++) {
  l += (str.charCodeAt(i) > 128) ? 2 : 1;
  if (l > len) return str.substring(0,i);
}
return str;
}

/*---------------------------------------------

* String °ø¹é Áö¿ì±â.
---------------------------------------------*/
String.prototype.trim = function(){
// Use a regular expression to replace leading and trailing
// spaces with the empty string
return this.replace(/(^\s*)|(\s*$)/g, "");
}

/*---------------------------------------------
* String ÃÑ ¹ÙÀÌÆ® ¼ö ±¸Çϱâ.
---------------------------------------------*/
String.prototype.bytes = function() {
var str = this;
var l = 0;
for (var i=0; i<str.length; i++) l += (str.charCodeAt(i) > 128) ? 2 : 1;
return l;
}

/*---------------------------------------------
* iframeÀÇ height¸¦ bodyÀÇ ³»¿ë¸¸Å­ ÀÚµ¿À¸·Î ´Ã·ÁÁÜ.
---------------------------------------------*/
function resizeRetry(){
if(ifrContents.document.body.readyState == "complete"){
  clearInterval(ifrContentsTimer);
}
else{
  resizeFrame(ifrContents.name);
}
}

var ifrContentsTimer;
var ifrContents;

function resizeFrame(name){

        var oBody = document.body;
        var oFrame = parent.document.all(name);
  ifrContents = oFrame;
        var min_height = 613; //iframeÀÇ ÃÖ¼Ò³ôÀÌ(³Ê¹« ÀÛ¾ÆÁö´Â °É ¸·±âÀ§ÇÔ, Çȼ¿´ÜÀ§, ÆíÁý°¡´É)
        var min_width = 540; //iframeÀÇ Ãּҳʺñ
        var i_height = oBody.scrollHeight + 10;

        var i_width = oBody.scrollWidth + (oBody.offsetWidth-oBody.clientWidth);

        if(i_height < min_height) i_height = min_height;
        if(i_width < min_width) i_width = min_width;
        oFrame.style.height = i_height;
        ifrContentsTimer = setInterval("resizeRetry()",100);
}

/*---------------------------------------------
* Ŭ¸³º¸µå¿¡ ÇØ´ç ³»¿ëÀ» º¹»çÇÔ.
---------------------------------------------*/

function setClipBoardText(strValue){
window.clipboardData.setData('Text', strValue);
alert("" + strValue +" \n\nÀ§ ³»¿ëÀÌ º¹»çµÇ¾ú½À´Ï´Ù.\n\nCtrl + v Å°¸¦ »ç¿ëÇÏ¿©, ºÙ¿© ³Ö±â¸¦ »ç¿ëÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù.");
}


/*---------------------------------------------
select ¿¡¼­ ±âÁ¸ÀÇ ¼±Åà °ªÀÌ ¼±ÅõǰÔ
----------------------------------------------*/
function selOrign(frm,val){
for(i=0; i < frm.length ; i++){
  if(frm.options[i].value == val){
  frm.options.selectedIndex = i ;
  return;
  }
}
}

/*---------------------------------------------
checkbox ¿¡¼­ ±âÁ¸ÀÇ ¼±Åà °ªÀÌ ¼±ÅõǰÔ
----------------------------------------------*/
function chkboxOrign(frm,val){
if(frm.length == null){
  if(frm.value == val)
  frm.checked = true;
}else{
  for(i=0;i<frm.length;i++){
  if(frm[i].value == val){
    frm[i].checked = true;
  }
  }
  return;
}
}

function chkboxOrign_multi(frm,objchk,val){
var i = 0;
for(i=0;i<frm.elements.length;i++){
  if(frm.elements[i].name == objchk){
  if(frm.elements[i].value == val){
    frm.elements[i].checked = true;
  }
  }
}
}

/*---------------------------------------------
radio ¿¡¼­ ±âÁ¸ÀÇ ¼±Åà °ªÀÌ ¼±ÅõǰÔ
----------------------------------------------*/
function radioOrign(frm,val){
for(i=0; i < frm.length ; i++){
  if(frm[i].value == val){
  frm[i].checked = true ;
  return ;
  }
}
}

/*---------------------------------------------
¼ýÀÚ¸¸ ÀԷ¹ޱâ
¿¹) onKeyDown="return onlyNum();"
----------------------------------------------*/
function onlyNum(){
if(
  (event.keyCode >= 48 && event.keyCode <=57) ||
  (event.keyCode >= 96 && event.keyCode <=105) ||
  (event.keyCode >= 37 && event.keyCode <=40) ||
  event.keyCode == 9 ||
  event.keyCode == 8 ||
  event.keyCode == 46
  ){
  //48-57(0-9)
  //96-105(Å°Æеå0-9)
  //8 : backspace
  //46 : delete key
  //9 :tab
  //37-40 : left, up, right, down
  event.returnValue=true;
}
else{
  //alert('¼ýÀÚ¸¸ ÀÔ·Â °¡´ÉÇÕ´Ï´Ù.');
  event.returnValue=false;
}
}

/*---------------------------------------------
ÁöÁ¤µÈ ±æÀ̹ÝÅ­¸¸ ÀԷ¹ޱâ
¿¹) onKeyUp="return  checkAllowLength(ÇöÀç¼ýÀÚº¸¿©Áö´Â°´Ã¼,¼ýÀÚ¼¿°´Ã¼ ,80);" onKeyDown="return checkAllowLength(ÇöÀç¼ýÀÚº¸¿©Áö´Â°´Ã¼,¼ýÀÚ¼¿°´Ã¼ ,80);"
----------------------------------------------*/

function checkAllowLength(objView, objTar, max_cnt){
if(event.keyCode > 31 || event.keyCode == "") {
  if(objTar.value.bytes() > max_cnt){
  alert("ÃÖ´ë " + max_cnt + "byte¸¦ ³Ñ±æ ¼ö ¾ø½À´Ï´Ù.");
  objTar.value = objTar.value.cut(max_cnt);
  }
}
objView.value = objTar.value.bytes();
}

  
/*--------------------------------------------
À̹ÌÁö ¸®»çÀÌÁî
---------------------------------------------*/
function resizeImg(imgObj, max_width, max_height){

var dst_width;
var dst_height;
var img_width;
var img_height;

img_width = parseInt(imgObj.width);
img_height = parseInt(imgObj.height);

if(img_width == 0 || img_height == 0){
  imgObj.style.display = '';
  return false;
}

    // °¡·ÎºñÀ² ¿ì¼±À¸·Î ½ÃÀÛ
    if(img_width > max_width || img_height > max_height) {
        // °¡·Î±âÁØÀ¸·Î ¸®»çÀÌÁî
        dst_width = max_width;
        dst_height = Math.ceil((max_width / img_width) * img_height);

        // ¼¼·Î°¡ max_height ¸¦ ¹þ¾î³µÀ» ¶§
        if(dst_height > max_height) {
  dst_height = max_height;
  dst_width = Math.ceil((max_height / img_height) * img_width);
        }

        imgObj.width = dst_width;
        imgObj.height = dst_height;
    }
    // °¡·ÎºñÀ² ¿ì¼±À¸·Î ³¡

imgObj.style.display = '';

return true;
}
/*---------------------------------------------
xml data Àоî¿À±â
----------------------------------------------*/
function getXmlHttpRequest(_url, _param){
    var objXmlConn;
    try{objXmlConn = new ActiveXObject("Msxml2.XMLHTTP.3.0");}
    catch(e){try{objXmlConn = new ActiveXObject("Microsoft.XMLHTTP");}catch(oc){objXmlConn = null;}}

    if(!objXmlConn && typeof XMLHttpRequest != "undefined") objXmlConn = new XMLHttpRequest();

    objXmlConn.open("GET", _url + "?" + _param, false);
    objXmlConn.send(null);
  
//code|message ÇüÅ·Π¸®ÅÏ
    return objXmlConn.responseText.trim().split("|");
}


/*---------------------------------------------------
cookie ¼³Á¤
-------------------------------------------------------*/

function getCookieVal (offset) {
  var endstr = document.cookie.indexOf (";", offset);
  if (endstr == -1) endstr = document.cookie.length;
  return unescape(document.cookie.substring(offset, endstr));
}

function GetCookie (name) {
  var arg = name + "=";
  var alen = arg.length;
  var clen = document.cookie.length;
  var i = 0;
  while (i < clen) { //while open
      var j = i + alen;
      if (document.cookie.substring(i, j) == arg)
        return getCookieVal (j);
      i = document.cookie.indexOf(" ", i) + 1;
      if (i == 0) break;
  } //while close
  return null;
}

function SetCookie (name, value) {
  var argv = SetCookie.arguments;
  var argc = SetCookie.arguments.length;
  var expires = (2 < argc) ? argv[2] : null;
  var path = (3 < argc) ? argv[3] : null;
  var domain = (4 < argc) ? argv[4] : null;
  var secure = (5 < argc) ? argv[5] : false;
  document.cookie = name + "=" + escape (value) +
      ((expires == null) ? "" :
        ("; expires=" + expires.toGMTString())) +
      ((path == null) ? "" : ("; path=" + path)) +
      ((domain == null) ? "" : ("; domain=" + domain)) +
      ((secure == true) ? "; secure" : "");
}

/* ---------------------------------------------
* ÇÔ¼ö¸í : checkSpecialChar
* ¼³  ¸í : Ư¼ö¹®ÀÚ Ã¼Å©
* ¿¹) if(!checkSpecialChar()) return;
---------------------------------------------*/
function checkSpecialChar(_obj){
    if(_obj.value.search(/[\",\',<,>]/g) >= 0) {
        alert("¹®ÀÚ¿­¿¡ Ư¼ö¹®ÀÚ( \",  ',  <,  > )°¡ ÀÖ½À´Ï´Ù.\nƯ¼ö¹®ÀÚ¸¦ Á¦°ÅÇÏ¿© ÁֽʽÿÀ!");
        _obj.select();
        _obj.focus();
    }
}
ÃßõÃßõ : 200 Ãßõ ¸ñ·Ï
¹øÈ£ Á¦¸ñ
2,885
input ÀÔ·Â ÇÊµå ¾ÕµÚ °ø¹é ½Ç½Ã°£ Á¦°Å
2,884
Placeholder Æ÷Ä¿½º½Ã °¨Ãß±â
2,883
MySQL Áߺ¹µÈ µ¥ÀÌÅ͸¦ »èÁ¦
2,882
MySQL Áߺ¹ µ¥ÀÌÅÍ È®ÀÎ
2,881
sessionStorage.getItem ¿Í sessionStorage.setItem
2,880
Á¦ÀÌÄõ¸® ·£´ýÀ¸·Î ¹è°æ»ö º¯°æ
2,879
preg match¿¡ °üÇÑ Á¤±Ô½Ä
2,878
Stream an audio file with MediaPlayer ¿Àµð¿À ÆÄÀÏ ½ºÆ®¸®¹Ö Çϱâ
2,877
Audio Streaming PHP Code
2,876
PHP $ SERVER ȯ°æ º¯¼ö Á¤¸®
2,875
Vimeo (ºñ¸Þ¿À) API ¸¦ »ç¿ëÇÏ¿© Ç÷¹À̾î ÄÁÆ®·ÑÇϱâ
2,874
iframe »ç¿ë½Ã ÇÏ´Ü¿¡ ¹ß»ýÇÏ´Â °ø¹é Á¦°Å¹æ¹ý
2,873
¾ÆÀÌÇÁ·¹ÀÓ(iframe) Àüüȭ¸é °¡´ÉÇÏ°Ô Çϱâ
2,872
ºÎÆ®½ºÆ®·¦(bootstrapk)¿¡¼­ »ç¿ëÇÏ´Â class¸í Á¤¸®
2,871
ºÎÆ®½ºÆ®·¦ CSS
2,870
Å©·Ò¿¡¼­ ¸¶Áø Á¶Àý
2,869
PHP ÇöÀç ÆäÀÌÁöÀÇ µµ¸ÞÀθíÀ̳ª urlµîÀÇ Á¤º¸ ¾Ë¾Æ¿À±â
2,868
PHP preg match all()
2,867
PHP ·Î À¥ÆäÀÌÁö ±Ü¾î¿À±â ¸ðµç ¹æ¹ý ÃÑÁ¤¸®!
2,866
[PHP] ¿ø°ÝÁö ÆÄÀÏ ÁÖ¼Ò ³ëÃâ ¾ÈÇÏ°í curl·Î ´Ù¿î·Îµå ¹Þ±â
2,865
PHP ÇÔ¼ö Á¤¸®
2,864
¾ÆÀÌÇÁ·¹ÀÓ(iframe) ºñÀ² À¯ÁöÇϸ鼭 Å©±â Á¶ÀýÇÏ´Â ¹æ¹ý
2,863
PHP ¹è¿­¿¡¼­ ¹«ÀÛÀ§·Î Çϳª »Ì¾ÆÁÖ´Â array rand() ÇÔ¼ö
2,862
PHP Á¤±Ô½Ä Á¤¸®
2,861
PHP Á¤±Ô½ÄÀ» È°¿ëÇÑ ÅÂ±× ¹× ƯÁ¤ ¹®ÀÚ¿­ Á¦°Å ¹× ÃßÃâ ¹æ¹ý
2,860
php Å©·Ñ¸µ ¶Ç´Â ÆÄ½Ì ÇÔ¼ö, Á¤±Ô½Ä ¸ðÀ½
2,859
Á¦ÀÌÄõ¸® ±âº» ¸í·É¾î
2,858
À¥ÆäÀÌÁö °¡·Î ¸ðµå¼¼·Î ¸ðµå ÀνÄÇϱâ
2,857
¸ð¹ÙÀÏ À¥ È­¸é °­Á¦ ȸÀü(°¡·Î¸ðµå °íÁ¤)
2,856
[HTML5]¿¡¼­ frameset ´ëü ¹æ¹ý°ú iframe ¼Ó¼º
¸ñ·Ï
¹ÂÁ÷Æ®·ÎÆ® ºÎ»ê±¤¿ª½Ã ºÎ»êÁø±¸ °¡¾ßµ¿ ¤Ó °³ÀÎÁ¤º¸Ãë±Þ¹æħ
Copyright ¨Ï musictrot All rights reserved.