336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.


//페이스북앱 인스타그램앱 따로처리하기

var ua = navigator.userAgent || navigator.vendor || window.opera;

if( (ua.indexOf("FBAN") > -1) || (ua.indexOf("FBAV") > -1) || (ua.indexOf('Instagram') > -1) || (ua.indexOf('GSA') > -1) ){

처리구문

}

336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

안녕하세요.

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<script>
    window.onload = function(){
    
        window.open("http://jdkblog.tistory.com","프로그래밍 블로그","width=400,height=500");
        //window.open("URL주소","제목","옵션이 들어갈곳");
 
        //옵션
 
        //- fullscreen = 전체 창. (yes/no)(default : no) 
        //- location = 주소창이 활성화. (yes/no)(default : yes) 
        //- menubar = 메뉴바 visible. (yes/no)(default : yes) 
        //- titlebar = 타이틀바. (yes/no)(default : yes) 
        //- toolbar = 툴바. (yes/no)(default : yes) 
        //- resizable = 창 사이즈 변경. (yes/no)(default : yes) 
        //- scrollbars = 스크롤바. (yes/no)(default : yes) 
        //- width = 창 가로 크기 
        //- height = 창 세로 크기 
    }
</script>
cs

 

감사합니다.

336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

안녕하세요.

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<script>
    window.onload = function(){
    //EX)필요한 것을 가져다가 붙여넣어서 사용하면 됩니다. ㅎㅎ
 
    alert("필요한 값 : "+document.body.clientWidth);
    // 가로길이
    //document.body.offsetWidth 
    //document.body.scrollWidth // (문서 전체의 크기)
    //document.body.clientWidth // (창의 크기)
    // 세로길이
    //document.body.offsetHeight
    //document.body.scrollHeight //(문서 전체의 크기)
    //document.body.clientHeight // (창의 크기)
 
    /* HTML5 표준이 정해져 있다. */
    // 가로 길이
    //window.innerWidth // 브라우저 윈도우 두께를 제외한 실질적 가로 길이
    //window.outerWidth // 브라우저 윈도우 두께를 포함한 브라우저 전체 가로 길이
    //세로길이
    //window.innerHeight // 브라우저 윈도우 두께를 제외한 실질적 세로 길이
    //window.outerHeight // 브라우저 윈도우 두께를 포함한 브라우저 전체 세로 길이
 
    }
</script>
cs

 

감사합니다.

336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

안녕하세요.

 

selectbox에 있는 값을 가져오거나 선택한 것을 가져오는 소스코드입니다.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<script>
    window.onload = function(){
 
        //차례대로 
        //선택한순서
        //옵션(select박스 안쪽에 있는 값을 가져오기 위함입니다.
        //값을 가져옵니다.
        var x = document.getElementById("mySelect").selectedIndex;
        var y = document.getElementById("mySelect").options;
        var z = document.getElementById("mySelect").value;
 
        //순서대로 값을 띄워줍니다.
        alert("Index: " + y[x].index + " is " + y[x].text+" is " + z);
 
    }
</script>
<select id="mySelect">
    <option value="Banana1!">Banana</option>
    <option value="값">값 선택</option>
 
</select>
 
cs

 

감사합니다.

336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

안녕하세요.

이번에는 url 주소창 값을 통해서 필요한 처리를 하는 방법을 알려드릴께요.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<script>
    window.onload = function(){
 
        //해당 일치하는 부분을 호출해 옵니다. 필요한 부분을 가져다가 쓰시면됩니다
        //ex)
        if(location.href == "http://jdkblog.tistory.com"){
            alert('해당 페이지로 이동합니다');
            location.href = location.href;
        }
        //-javascript-
 
        //location.href -> http://localhost:8088/login/login.do?key=value
 
        //location.protocol -> http:
        //location.host -> localhost:8088 
        //location.pathname -> /login/login.do
        //location.search -> ?key=value
 
 
 
 
 
 
        //-jquery-
 
        //jQuery(location).attr('href') -> http://localhost:8088/login/login.do?key=value
        //jQuery(location).attr('protocol') -> http:
        //jQuery(location).attr('host') -> localhost:8088 
        //jQuery(location).attr('pathname') -> /login/login.do
        //jQuery(location).attr('search')-> ?key=  
    }
</script>
 
 
cs

 

감사합니다.

336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

안녕하세요.

이번엔 브라우저를 어떤 것을 사용하는지 알려주는 소스입니다.

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<script>
    window.onload = function (){
        alert(getBrowser());
    }
    
    function getBrowser(){ 
        var agt = navigator.userAgent.toLowerCase();  //브라우저 정보 획득
        if (agt.indexOf("chrome"!= -1return 'Chrome'
        if (agt.indexOf("opera"!= -1return 'Opera'
        if (agt.indexOf("staroffice"!= -1return 'Star Office'
        if (agt.indexOf("webtv"!= -1return 'WebTV'
        if (agt.indexOf("beonex"!= -1return 'Beonex'
        if (agt.indexOf("chimera"!= -1return 'Chimera'
        if (agt.indexOf("netpositive"!= -1return 'NetPositive'
        if (agt.indexOf("phoenix"!= -1return 'Phoenix'
        if (agt.indexOf("firefox"!= -1return 'Firefox'
        if (agt.indexOf("safari"!= -1return 'Safari'
        if (agt.indexOf("skipstone"!= -1return 'SkipStone'
        if (agt.indexOf("msie"!= -1return 'Internet Explorer'
        if (agt.indexOf("netscape"!= -1return 'Netscape'
        if (agt.indexOf("mozilla/5.0"!= -1return 'Mozilla'
    }
 
</script>
cs

 

감사합니다.

336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

 

 

$.ajax({
   type:'POST',
   data:new FormData($('#formId')[0]),
   cache: false,
   processData: false,
   contentType:false,
   url:"URL주소",
   success:성공함수,
   error:에러함수
  });

 

 

 

336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

안녕하세요. 이번엔 JAVASCRIPT에서 background 이미지와 이미지 크기 및 반복 안하는 방법에 대해서 간단하게 알려드리겠습니다..

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
<script>
    window.onload = function(){
    //반복제거, url
    document.getElementById("div").style.backgroundRepeat = "no-repeat";
    //이미지 등록
    document.getElementById("div").style.backgroundImage = "url('해당파일위치')";
    //이미지 사이즈
    document.getElementById("div").style.backgroundSize = "200px";
    }
</script>
 
<div id='div'>
 
</div>
cs
336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

안녕하세요. 이번엔 JAVASCRIPT URL의 Parameter를 처리하는 방법을 알려드리겠습니다.

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
function getParams() {
    // 파라미터가 담길 배열
    var param = new Array();
 
    // 현재 페이지의 url
    var url = decodeURIComponent(location.href);
    // url이 encodeURIComponent 로 인코딩 되었을때는 다시 디코딩 해준다.
    url = decodeURIComponent(url);
 
    var params;
    // url에서 '?' 문자 이후의 파라미터 문자열까지 자르기
    params = url.substring( url.indexOf('?')+1, url.length );
    // 파라미터 구분자("&") 로 분리
    params = params.split("&");
 
    // params 배열을 다시 "=" 구분자로 분리하여 param 배열에 key = value 로 담는다.
    var size = params.length;
    var key, value;
    for(var i=0 ; i < size ; i++) {
        key = params[i].split("=")[0];
        value = params[i].split("=")[1];
 
        param[key] = value;
    }
 
    return param;
}
cs

 

 

336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

안녕하세요. URL주소를 가져오는 방법을 알려드릴께요

 

1
2
3
4
5
6
7
8
9
<script>
    window.onload = function(){
        //전체주소
        console.log("url : "+location.href);
 
        //http:, localhost:port번호, index.html ?test=tttt 순으로 나누어져 있습니다.
        console.log("url : "+location.protocol+"//"+location.host+""+location.pathname+""+location.search);
    }
</script>
cs

+ Recent posts