obj.hasOwnProperty("key") 

http://stackoverflow.com/questions/1098040/checking-if-a-key-exists-in-a-javascript-object

'javascript' 카테고리의 다른 글

is_numberic 자바스크립트용  (0) 2016.06.30
nan 관련 함수  (0) 2016.06.30
자바스크립트 test() 함수  (0) 2016.06.30
자바스크립트 numberformat 상속 확장  (0) 2016.06.08
자바스크립트용 inarray  (0) 2016.06.03
Posted by 이상욱1
,

http://ictknowledge.net/javascript-is_numeric-php-like-function/

'javascript' 카테고리의 다른 글

자바스크립트 오브젝트 해당키포함 여부  (0) 2016.11.14
nan 관련 함수  (0) 2016.06.30
자바스크립트 test() 함수  (0) 2016.06.30
자바스크립트 numberformat 상속 확장  (0) 2016.06.08
자바스크립트용 inarray  (0) 2016.06.03
Posted by 이상욱1
,

nan 관련 함수

javascript 2016. 6. 30. 14:23

    //NaN 은 not a number라는 뜻으로 

    // 숫자 형태 인지 

    console.log(isNaN('1')); // false

    console.log(isNaN(1)); // false

    console.log(isNaN('sdfdsfsdf')); // true

Posted by 이상욱1
,

https://opentutorials.org/module/532/6580


var sPattern = '<정규표현식>';

sPattern.test(mValue)

이런식으로 이용하면 true false 값으로 확인 할수있다.

'javascript' 카테고리의 다른 글

is_numberic 자바스크립트용  (0) 2016.06.30
nan 관련 함수  (0) 2016.06.30
자바스크립트 numberformat 상속 확장  (0) 2016.06.08
자바스크립트용 inarray  (0) 2016.06.03
자바스크립트 RGB to Hex  (0) 2016.05.24
Posted by 이상욱1
,
자바스크립트 numberformat 상속 확장 해서 쓴 경우 
http://stove99.tistory.com/113
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
// 숫자 타입에서 쓸 수 있도록 format() 함수 추가
Number.prototype.format = function(){
    if(this==0) return 0;
 
    var reg = /(^[+-]?\d+)(\d{3})/;
    var n = (this + '');
 
    while (reg.test(n)) n = n.replace(reg, '$1' + ',' + '$2');
 
    return n;
};
 
// 문자열 타입에서 쓸 수 있도록 format() 함수 추가
String.prototype.format = function(){
    var num = parseFloat(this);
    if( isNaN(num) ) return "0";
 
    return num.format();
};
 
 
 
// 숫자 타입 test
var num = 123456.012;
console.log(num.format());               // 123,456.012
 
num = 13546745;
console.log(num.format());               // 13,546,745
 
// 문자열 타입 test
console.log("12348".format());           // 12,348
console.log("12348.6456".format());      // 12,348.6456



'javascript' 카테고리의 다른 글

nan 관련 함수  (0) 2016.06.30
자바스크립트 test() 함수  (0) 2016.06.30
자바스크립트용 inarray  (0) 2016.06.03
자바스크립트 RGB to Hex  (0) 2016.05.24
키배열 length 구하기  (0) 2016.04.19
Posted by 이상욱1
,

jQuery.inArray( value, array [, fromIndex] )Returns : Number

개요 : 배열 내의 값을 찾아서 인덱스를 반환합니다.(요소가 없을 경우 -1을 반환).

  • jQuery.inArray( value, array [, fromIndex] )
  • value 찾을 value.
  • array 대상 배열
  • fromIndex 검색이 시작될 배열의 인덱스. 기본값은 0이고 배열 전체를 검색합니다.

$.inArray() 함수는 JavaScript의 기본 함수인 .indexOf() 함수와 유사합니다. 만일 배열 내에 첫번째 요소가 value 인자와 일치한다면 $.inArray() 함수는 0을 리턴합니다.



http://findfun.tistory.com/406



http://rucaus.egloos.com/m/2402042

'javascript' 카테고리의 다른 글

자바스크립트 test() 함수  (0) 2016.06.30
자바스크립트 numberformat 상속 확장  (0) 2016.06.08
자바스크립트 RGB to Hex  (0) 2016.05.24
키배열 length 구하기  (0) 2016.04.19
다중 input 시 name에 배열 주기  (1) 2016.03.08
Posted by 이상욱1
,

http://stackoverflow.com/questions/5623838/rgb-to-hex-and-hex-to-rgb

http://stackoverflow.com/questions/1740700/how-to-get-hex-color-value-rather-than-rgb-value

'javascript' 카테고리의 다른 글

자바스크립트 numberformat 상속 확장  (0) 2016.06.08
자바스크립트용 inarray  (0) 2016.06.03
키배열 length 구하기  (0) 2016.04.19
다중 input 시 name에 배열 주기  (1) 2016.03.08
태그생성하면서 id 값도 주기  (0) 2016.03.02
Posted by 이상욱1
,


일반적으로 배열 내 원소의 개수를 구할 땐 배열명.length 를 쓰면 간단히 구할 수 있는데, {키:값} 쌍으로 이루어진 JSON 형식의 오브젝트는 length로는 엘리먼트의 개수가 나오지 않습니다.

그럴때 무식하게 for(i in obj) 형식으로 루프를 돌리곤 했는데, 이게 제 내공 부족이었네요.

간단하게, 

var ex_obj = { 'a' : '1st', 'b' : '2nd', 'c' : '3rd', 'd' : '4th' };
var obj_length = Object.keys(ex_obj).length;

http://egloos.zum.com/beewee/v/947615


'javascript' 카테고리의 다른 글

자바스크립트용 inarray  (0) 2016.06.03
자바스크립트 RGB to Hex  (0) 2016.05.24
다중 input 시 name에 배열 주기  (1) 2016.03.08
태그생성하면서 id 값도 주기  (0) 2016.03.02
json -> string  (0) 2016.03.02
Posted by 이상욱1
,

name 에 name = 'searchCategory[]' 해서  배열로  받을수있다  같은 이름을 써서 


[jQuery] input 배열일 때 selector$(“input[name=’nn[]’]”).val(“0000”);

http://ncube.net/8677

'javascript' 카테고리의 다른 글

자바스크립트 RGB to Hex  (0) 2016.05.24
키배열 length 구하기  (0) 2016.04.19
태그생성하면서 id 값도 주기  (0) 2016.03.02
json -> string  (0) 2016.03.02
jquery li 태그 value  (0) 2016.02.16
Posted by 이상욱1
,

http://stackoverflow.com/questions/9422974/createelement-with-id

'javascript' 카테고리의 다른 글

키배열 length 구하기  (0) 2016.04.19
다중 input 시 name에 배열 주기  (1) 2016.03.08
json -> string  (0) 2016.03.02
jquery li 태그 value  (0) 2016.02.16
자바스크립트 현재 날짜  (0) 2016.02.12
Posted by 이상욱1
,