'오토바이' 카테고리의 다른 글

BMW C650GT  (0) 2017.05.18
[SUZUKI YZF R6] 스즈키 YZF-R6  (0) 2017.04.18
티맥스 튜닝 사진  (0) 2017.03.19
보이저 풀튜닝  (0) 2017.03.19
마제스티 풀튜닝  (0) 2017.03.19











'자동차' 카테고리의 다른 글

현대 제네시스 G70 발표  (0) 2017.09.15
[Benz] 벤츠 C63 AMG 쿠페  (0) 2017.04.18
[BMW] BMW I8  (0) 2017.04.18
[HONDA]혼다 Civic 2017  (0) 2017.04.18











'자동차' 카테고리의 다른 글

현대 제네시스 G70 발표  (0) 2017.09.15
[Ford] 포드 F150  (0) 2017.04.18
[BMW] BMW I8  (0) 2017.04.18
[HONDA]혼다 Civic 2017  (0) 2017.04.18








'자동차' 카테고리의 다른 글

현대 제네시스 G70 발표  (0) 2017.09.15
[Ford] 포드 F150  (0) 2017.04.18
[Benz] 벤츠 C63 AMG 쿠페  (0) 2017.04.18
[HONDA]혼다 Civic 2017  (0) 2017.04.18











'자동차' 카테고리의 다른 글

현대 제네시스 G70 발표  (0) 2017.09.15
[Ford] 포드 F150  (0) 2017.04.18
[Benz] 벤츠 C63 AMG 쿠페  (0) 2017.04.18
[BMW] BMW I8  (0) 2017.04.18

Foreach와 같은 jQuery


$.each(array,function(index, item){


var output='';



output+='<a href="'+item.link+'">';


output+='<h1>'+item.name+'</h1>';


output+='</a><br>';



document.body.innerHTML+=output;


})




forEach응용방법


array.forEach(function (item){


//console.log(item.name+' / '+item.link);



var output='';


output+='<a href="'+item.link+'">';


output+=item.name;


output+='</a><br>';



document.body.innerHTML+=output;



});




배열과 For문, 향상된 FOR문


 


<script type="text/javascript" src="./js/jquery-2.1.4.js"></script>


<script type="text/javascript">


    $(document).ready(function(){


        var array=[


                {name:'Naver',link:'http://www.naver.com'},


                {name:'Daum',link:'http://www.daum.net'},


                {name:'google',link:'http://www.google.com'}                


        ];


        //for    


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


            console.log(array[i].name+'/'+array[i].link);


        }


        for(var i in array){


            console.log(array[i].name+'/'+array[i].link);


        }


    });


</script>




배열관리 .each


 


<script type="text/javascript" src="./js/jquery-2.1.4.js"></script>


<script type="text/javascript">


    $(document).ready(function(){


        $('h2').each(function(index,item){


            //console.log(index);


            //console.log(item);


            //console.log(item.innerHTML);


            this.innerHTML='hello';


            


        })


    });


</script>


<body>


    <h2>item-0</h2>


    <h2>item-1</h2>


    <h2>item-2</h2>


    <h2>item-3</h2>


</body>




객체의 확장


 


<script type="text/javascript" src="./js/jquery-2.1.4.js"></script>


<script type="text/javascript">


    $(document).ready(function(){


        var object={name:'윤인성'};


        


        $.extend(object,{


            region:'서울특별시 강서구',


            part:'세컨드 기타'


        })


        


        var output='';


        $.each(object, function(key,item){


            output+=key+' : '+item+'\n';


        })


        alert(output);


    });


</script>


[출처] http://blog.naver.com/skawo32167/220493716793

1
2
3
4
5
6
7
8
9
10
11
/*
** 폼
**
** <input type="text" numberonly="true" />  // 숫자만 입력 가능한 텍스트박스
** <input type="text" datetimeonly="true" /> // 숫자, 콜론(:), 하이픈(-)만 입력 가능한 텍스트박스
*/
$(function()
{
 $(document).on("keyup""input:text[numberOnly]"function() {$(this).val( $(this).val().replace(/[^0-9]/gi,"") );});
 $(document).on("keyup""input:text[datetimeOnly]"function() {$(this).val( $(this).val().replace(/[^0-9:\-]/gi,"") );});
});


만약 on 메소드가 없는 존나 옛날 버전이라면


1
2
3
4
5
6
7
8
9
$(function()
{
    $("input:text[numberOnly]").live("keyup"function() {
        $(this).val( $(this).val().replace(/[^0-9]/gi,"") );
    });
    $("input:text[datetimeOnly]").live("keyup"function(){
        $(this).val( $(this).val().replace(/[^0-9:\-]/gi,"") );
    });
});

으로 해주면 된다. 


약간에 문제가 있는듯 합니다.

한글만 입력하고 focus가 나가면 한글 1글자가 남는.....


출처: http://hobbiez.tistory.com/396 [취미생활]

입력 받은 값 숫자 유효성 체크입니다.


<input type="text" id="test" value="123abc456"/>

var test = $('#test').val();

if ( $.isNumeric(test) ) {

alert('숫자만 입력해주세요.');

$('#test').val('');

}


이런식으로 체크하고 초기화 하면 끝

String text = "홍길동,010-1234-5678,대한민국";
String[] textArr = text .split(",");
배열에 담아서 순서대로 꺼내서 쓰면 끝
String name = textArr[0];
String phone = textArr[1];
String addr = textArr[2];

eclipse에서 대소문자 단축키 입니다.


소문자 변환 : 블럭 지정 후 ctrl + shift + Y


대문자 변환 : 블럭 지정 후 ctrl + shift + X


세로 영역 드래드 방법은

 

shift + alt + A 


드래그 끝내려면  똑같이 한번더 눌러주면 종료됩니다.^^

'개발 > JAVA' 카테고리의 다른 글

myBatis selectone null 처리  (0) 2017.11.21
Spring VO 객제 복사 하기  (0) 2017.08.04
java 인코딩 깨질때 [한글 인코딩 오류] 체크  (0) 2017.07.21
Java split 사용법  (0) 2017.04.05
json vo객체에 list로 받기  (0) 2017.03.15

+ Recent posts