팩토리 » Api

storagegetcount

Description

웹스토리지에 저장된 키의 갯수를 반환하는 API이다.

Parameters

Parameters Type Description
nStorageType short 스토리지 종류

Return Value

Type Description
short 키 개수

Remark

스토리지 종류는 아래와 같다.
0 : 세션스토리지(sessionStorage)
1 : 로컬스토리지(localStorage)

* 세션스토리지
  - 도메인에 대해서 세션이 유지되는 동안만 데이터가 유지된다.
  - iframe간에만 정보가 공유된다.
** 로컬스토리지
  - 도메인에 대해서 명시적으로 삭제하기 전까지 데이터가 영구히 유지된다.
  - 오리진이 같은 경우 모든 탭과 창에서 정보가 공유된다.

Example

function btn_getstoragecount_on_mouseup(objInst) { factory.consoleprint("세션스토리지 키 갯수 : " + factory.storagegetcount(0)); factory.consoleprint("로컬스토리지 키 갯수 : " + factory.storagegetcount(1)); }

See Also

storagegetkey
storagegetkeylist
storagegetitem
storagesetitem
storageremoveitem
storageclear

Viewer Ver.

9.1.1.1

Update Date

20210120