'[.js] no category' 카테고리의 다른 글
include , 포함인지 여부 (0) | 2017.09.13 |
---|---|
1초에 한번 함수 실행 (0) | 2017.09.06 |
정수로 casting 예제 (0) | 2017.09.06 |
include , 포함인지 여부 (0) | 2017.09.13 |
---|---|
1초에 한번 함수 실행 (0) | 2017.09.06 |
정수로 casting 예제 (0) | 2017.09.06 |
어떤 변수에 "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> |
base html 왁구 (0) | 2019.08.03 |
---|---|
1초에 한번 함수 실행 (0) | 2017.09.06 |
정수로 casting 예제 (0) | 2017.09.06 |
<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>
<a href="javascript:stop();" > stop </a>
</div>
</body>
</html>
base html 왁구 (0) | 2019.08.03 |
---|---|
include , 포함인지 여부 (0) | 2017.09.13 |
정수로 casting 예제 (0) | 2017.09.06 |
<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>
base html 왁구 (0) | 2019.08.03 |
---|---|
include , 포함인지 여부 (0) | 2017.09.13 |
1초에 한번 함수 실행 (0) | 2017.09.06 |