반응형
반응형

How TO - Sort a Table

 

html 테이블 정렬

 

.

반응형
반응형

[PostgreSql] 버전 확인, 확장프로그램 확인 

 

select version();
select * from pg_available_extensions;
반응형
반응형

국외 IP 조회

 

http://cqcounter.com/whois/

 

cqcounter.com

IP address and domain name whois lookup, domain information, dns reports, reverse ip resolver, geo location map

cqcounter.com

 

반응형
반응형

textarea 입력대로 화면에 출력하기

<!DOCTYPE html>
<head>
<title>Recipe</title>
<script>

window.onload=function() {
 document.getElementById("preview").onclick=processText;
}

function processText() {
 var txtBox = document.getElementById("inputbox");
 var lines = txtBox.value.split("\n");

 // generate HTML version of text
 var resultString  = "<p>";
 for (var i = 0; i < lines.length; i++) {
   resultString += lines[i] + "<br />";
 }
 resultString += "</p>";

 // print out to page
 var   blk   = document.getElementById("result");
 blk.innerHTML  =  resultString; 
}

</script>

</head>
<body>
<textarea id="inputbox" cols="20" rows="10"></textarea>
<div><button id="preview">Preview</button></div>
<div id="result"></div>
</body>

textarea를 줄별로 처리하기

//줄 바꿈 문자를 기준으로 textarea 문자열을 분리
var txtBox = document.getElementById("inputbox");
var lines = txtBox.value.split("\n");

//내용을 HTML 버전으로 변경
var resultString  = "<p>";
for (var i = 0; i < lines.length; i++) {
    resultString += lines[i] + "<br>";
}
resultString += "</p>";

//페이지에 출력
var   blk   = document.getElementById("result");
blk.innerHTML  =  resultString; 
반응형
반응형

[Javascript] 숫자 3자리 단위마다 콤마(comma) 찍기 

stackoverflow.com/questions/2901102/how-to-print-a-number-with-commas-as-thousands-separators-in-javascript

 

How to print a number with commas as thousands separators in JavaScript

I am trying to print an integer in JavaScript with commas as thousands separators. For example, I want to show the number 1234567 as "1,234,567". How would I go about doing this? Here is how I am...

stackoverflow.com

function numberWithCommas(x) {
    return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
 
function comma(num){
    var len, point, str; 
       
    num = num + ""; 
    point = num.length % 3 ;
    len = num.length; 
   
    str = num.substring(0, point); 
    while (point < len) { 
        if (str != "") str += ","; 
        str += num.substring(point, point + 3); 
        point += 3; 
    } 
     
    return str;
 
}

 

 

반응형
반응형

textarea, placeholder에서 개행처리 - \r\n 

 

줄내림할 곳에  \r\n 대신  &#10 을 넣어서 해보면 개행이 된다. 

 

 

반응형

+ Recent posts