'[.js] no category'에 해당되는 글 4건

  1. 2019.08.03 base html 왁구
  2. 2017.09.13 include , 포함인지 여부
  3. 2017.09.06 1초에 한번 함수 실행
  4. 2017.09.06 정수로 casting 예제



<html>
<head>
<title> </title>
<style type="text/css">
#table {display: table; width: 50%;}
.row {display: table-row;}
.cell {display: table-cell; padding: 3px; border-bottom: 1px solid #DDD; font-size: small; }
.col1 { width: 20%;}
.col2 {width: 20%;}
.col3 {width: 40%;}
.col4 {width: 20%;}
</style>
</head>
<script language="javascript" >
</script>
<body>
<div id="table">
<div class="row">
<span class="cell col1"> 1-1</span>
<span class="cell col2"> 1-2</span>
<span class="cell col3"> 1-3</span>
<span class="cell col4"> 1-4 </span>
</div>
<div class="row">
<span class="cell col1"> 2-1</span>
<span class="cell col2"> 2-2</span>
<span class="cell col3"> 2-3</span>
<span class="cell col4"> 2-3</span>
</div>
<div class="row">
<span class="cell col1"> 2-1</span>
<span class="cell col2"> 2-2</span>
<span class="cell col3"> 2-3</span>
<span class="cell col4"> 2-4</span>
</div>
</div>
</body>
</html>


'[.js] no category' 카테고리의 다른 글

include , 포함인지 여부  (0) 2017.09.13
1초에 한번 함수 실행  (0) 2017.09.06
정수로 casting 예제  (0) 2017.09.06
Posted by 혜화초보
,


어떤 변수에 "aaa" 라는 값이 포함 되어 있는지

아닌지를 찾을때 ..


방법


찾은게 .. include 인데..


이건 ..


익스플로러 12 이상에서만 가능하다고 함.


indexOf 로 찾을수 있습니다.~


아래 결과는 ddd 의 시작 위치를 리턴.


없는 경우 찾는 값이 없는 경우 -1 리턴.


익스 버전 상관 없이 가능한 함수.


 

<!DOCTYPE html>

<html>

<head>

</head>


<script language='javascript' >


function test(   ){


  console.log( '--- ');

  var a = 'sef ccc ddd  ddd ';

  console.log( ' --- ' + a.indexOf("ddd") );

}

 

test();


</script>

<body>


</body>

</html>






'[.js] no category' 카테고리의 다른 글

base html 왁구  (0) 2019.08.03
1초에 한번 함수 실행  (0) 2017.09.06
정수로 casting 예제  (0) 2017.09.06
Posted by 혜화초보
,

<html>

<head>

</head>

<script  language="javascript"  >


var aa = 0;


function exe(){

  aa = setInterval("roofing_func()", 1000); //  1000 = 1초   1초마다 roofing_func 를 실행하라.~

}


function stop(){

  clearInterval(aa);    

}


function roofing_func(){

  console.log( 'a');

}


</script>

    <body  >

        <div  style="  height:80px ; padding-top:200px ; padding-left:200px "  >

          <a href="javascript:exe();"  >  click  </a>        

          &nbsp;&nbsp;

          <a href="javascript:stop();"  >  stop  </a>                  

        </div>

        

 

    </body>

</html>

'[.js] no category' 카테고리의 다른 글

base html 왁구  (0) 2019.08.03
include , 포함인지 여부  (0) 2017.09.13
정수로 casting 예제  (0) 2017.09.06
Posted by 혜화초보
,

<html>

<head>

</head>

<script  language="javascript"  >

 

function exe(){

 

  var a1 = '10.02';

  console.log( ' value: '+ a1 );

  console.log( ' value: '+   typeof( a1 ) ); //string

    

  a1 = parseInt( a1 );

  console.log( ' value: '+   typeof( a1 ) );  //number

  console.log( ' value: '+ a1 );

    

  a1 += 3.2;  

  console.log( ' value: '+ a1 );  //13.2

  console.log( ' value: '+   typeof( a1 ) ); //number

}

 

 

 

</script>

    <body  >

        <div  style="  height:80px ; padding-top:200px ; padding-left:200px "  >

          <a href="javascript:exe();"  >  click  </a>        

        </div>

        

 

    </body>

</html>

'[.js] no category' 카테고리의 다른 글

base html 왁구  (0) 2019.08.03
include , 포함인지 여부  (0) 2017.09.13
1초에 한번 함수 실행  (0) 2017.09.06
Posted by 혜화초보
,