<script type="text/javascript">


$(document).ready(function() {

   //add more file components if Add is clicked

   $('#addFile').click(function() {

       var fileIndex = $('#tbodyContents tr td').children().length - 5;

       $('#tbodyContents').append(

               '<tr><th>file'+ fileIndex + '</th>' + 

               '<td class=\"td_left\"><input type=\"file\" name=\"files['+ (fileIndex -1) +']\" style=\"width:500px; height:16px; padding:2px 0 2px 2px;\" /></td>'+

               '</tr>');

   });

});

</script>





<table width="100%" border="0" cellspacing="0" summary="">

<caption></caption>

<colgroup>

<col width="20%" />

<col width="*" />

</colgroup>

<tbody id="tbodyContents">

<tr>

<th>제목</th>

<td class="td_left"><input id="subject" name="subject" type="text" style="width:500px; height:16px; padding:2px 0 2px 2px;"/></td>

</tr>

<tr>

<th>이미지 카테고리</th>

<td class="td_left"><input id="imgCategory" name="imgCategory" type="text" style="width:500px; height:16px; padding:2px 0 2px 2px;"/></td>

</tr>

<tr>

<th>키비쥬얼 순서</th>

<td class="td_left"><input id="keyVisual" name="keyVisual" type="text" style="width:500px; height:16px; padding:2px 0 2px 2px;"/></td>

</tr>

<tr>

<th>text1</th>

<td class="td_left"><input id="text1" name="text1" type="text" style="width:500px; height:16px; padding:2px 0 2px 2px;"/></td>

</tr>

<tr>

<th>text2</th>

<td class="td_left"><input id="text2" name="text2" type="text" style="width:500px; height:16px; padding:2px 0 2px 2px;"/></td>

</tr>

<tr>

<th>text3</th>

<td class="td_left"><input id="text3" name="text3" type="text" style="width:500px; height:16px; padding:2px 0 2px 2px;"/></td>

</tr>

<tr>

<th>file1</th>

<td class="td_left"><input name="files[0]" type="file"  style="width:500px; height:16px; padding:2px 0 2px 2px;"/></td>

</tr>

</tbody>

</table>

<script type="javascript">

$(".search input[type=text]").keypress(function(e) { 

    if (e.keyCode == 13){
        action();

    }    
});

</script> 

 

 

.search class명을 가진 엘리멘트 안에 input type이 text, 엔터(e.keyCode == 13)치면 함수호출


textarea{resize:none;}


<input type="text" onkeypress="javascript:if(event.keyCode==13){goSearch();return false;}" />


프린트 팝업 페이지 에서,


$(document).ready(function(){

$('#contentArea').html($(opener.document).find("#content").html());

});

function showLayer( obj, area ) {

var mapDataList = document.getElementsByClassName("mapDataList");

document.getElementById("city1").innerHTML = obj;

for (var i = 0; i < mapDataList.length; ++i) {

mapDataList[i].style.display = "none";

}

document.getElementById(area).style.display = "block";

}

function addKeyImg(imgDiv,fileObj,fileObjValue){

var imgPath = '';


//파일형식이 이미지형식이 아닌경우  

if(!/(\.gif|\.jpg|\.jpeg|\.png)$/i.test(fileObj.value) && fileObj.value !='') {

   alert("이미지 형식의 파일을 선택하십시오");

   fileObj.select();

   document.selection.clear();   

   return;

   

//파일형식이 맞는경우

}else{  

var imgDiv = (typeof(imgDiv) == "object") ? imgDiv : document.getElementById(imgDiv);

var ua = window.navigator.userAgent;

            if (ua.indexOf("MSIE") > -1) { //IE 

                if (fileObj.value.indexOf("\\fakepath\\") < 0) {

                imgPath = fileObj.value;

                } else {

                fileObj.select();

                    var selectionRange = document.selection.createRange();

                    imgPath = selectionRange.text.toString();

                    //fileObj.blur();

                    imgDiv.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fi" + "le://" + imgPath + "', sizingMethod='scale')";

                }

                

} else { //파폭적용

            }

}

}


HTML5_pdf.zip



참고자료

'Client Standard > HTML' 카테고리의 다른 글

Web DB  (0) 2013.08.01
Web Storage  (0) 2013.08.01
Drag and Drop  (0) 2013.08.01
HTML5 Video  (0) 2013.08.01
HTML5 Canvas  (0) 2013.08.01

function createDrop(input) {

var ul = document.getElementById(input);

ul.setAttribute("ondragenter", "dEnter()");

ul.setAttribute("ondragover", "dOver()");

ul.setAttribute("ondrop", "dDrop('"  + input + "')");

}


dDrop(input) {} 이렇게 주고 싶을 떄 , " " 쌍 따옴표 안에 인자값을 위와 같이 주면 된다.


dDrop('input') -> dDrop('" + input + "')  

'Client Standard > JavaScript & jQuery' 카테고리의 다른 글

[Js] getClass, display:none, block  (0) 2013.11.25
[Image 미리보기] Js Code  (0) 2013.11.15
[JavaScript] typeof 타입형 얻어오기  (0) 2013.08.02
JavaScript Event Model  (0) 2013.08.01
DOM  (0) 2013.08.01

// typeof 변수 형태로 그 해당 변수의 형을 알수 있다


var val;

if (typeof val == "undifined")

console.log("true");

'Client Standard > JavaScript & jQuery' 카테고리의 다른 글

[Image 미리보기] Js Code  (0) 2013.11.15
[JavaScript] 함수내 함수 인자값 주기  (0) 2013.08.02
JavaScript Event Model  (0) 2013.08.01
DOM  (0) 2013.08.01
BOM  (0) 2013.08.01

+ Recent posts