Baseline Widely available
Web Storage APIì Storage
ì¸í°íì´ì¤ë í¹ì ëë©ì¸ì ìí ì¸ì
ì ì¥ì ëë ë¡ì»¬ ì ì¥ìì ì ê·¼ ê²½ë¡ë¡ì ë°ì´í°ë¥¼ ì¶ê°íê³ ìì íê±°ë ìì í ì ììµëë¤.
ëë©ì¸ì ì¸ì
ì ì¥ì를 ìì í´ì¼ íë©´ Window.sessionStorage
ì, ë¡ì»¬ ì ì¥ì를 ìì í´ì¼ íë©´ Window.localStorage
ì ì ê·¼íì¸ì.
Storage.length
ì½ê¸° ì ì©
Storage
ê°ì²´ì ì ì¥ë ë°ì´í° í목ì ì를 ë°íí©ëë¤.
Storage.key()
주ì´ì§ ì«ì n
ì ëíì¬ ì ì¥ìì n
ë²ì§¸ í목 í¤ë¥¼ ë°íí©ëë¤.
Storage.getItem()
주ì´ì§ í¤ì ì°ê²°ë ê°ì ë°íí©ëë¤.
Storage.setItem()
í¤ê° ì ì¥ìì ì¡´ì¬íë ê²½ì° ê°ì ì¬ì¤ì í©ëë¤. ì¡´ì¬íì§ ìì¼ë©´ í¤ì ê°ì ì ì¥ìì ì¶ê°í©ëë¤.
Storage.removeItem()
주ì´ì§ í¤ë¥¼ ì ì¥ììì ì ê±°í©ëë¤.
Storage.clear()
ì ì¥ìì 모ë í¤ë¥¼ ì ì¥ììì ì ê±°í©ëë¤.
ìë ì½ëììë localStorage
ì ì ê·¼í´ Storage
ê°ì²´ë¥¼ ì ê·¼í©ëë¤. ì°ì !localStorage.getItem('bgcolor')
를 ì¬ì©í´ ë°ì´í°ê° ì ì¥ìì ì¡´ì¬íëì§ ììë
ëë¤. ë°ì´í°ê° ìì¼ë©´ Storage.getItem()
ì¼ë¡ íìí í setStyles()
ë¡ íì´ì§ ì¤íì¼ì ë°ê¿ëë¤. ë°ì´í°ê° ìì¼ë©´ populateStorage()
í¨ì를 í¸ì¶íê³ , ê·¸ ìììë Storage.setItem()
ì íµí´ ë°ì´í°ë¥¼ ì¤ì í©ëë¤. ê·¸ íìë ëì¼íê² setStyles()
를 ì¬ì©í©ëë¤.
if (!localStorage.getItem("bgcolor")) {
populateStorage();
} else {
setStyles();
}
function populateStorage() {
localStorage.setItem("bgcolor", document.getElementById("bgcolor").value);
localStorage.setItem("font", document.getElementById("font").value);
localStorage.setItem("image", document.getElementById("image").value);
}
function setStyles() {
var currentColor = localStorage.getItem("bgcolor");
var currentFont = localStorage.getItem("font");
var currentImage = localStorage.getItem("image");
document.getElementById("bgcolor").value = currentColor;
document.getElementById("font").value = currentFont;
document.getElementById("image").value = currentImage;
htmlElem.style.backgroundColor = "#" + currentColor;
pElem.style.fontFamily = currentFont;
imgElem.setAttribute("src", currentImage);
}
ì°¸ê³ : ì¤ì ìë ìì ë ì í¬ì Web Storage Demoìì ë³¼ ì ììµëë¤.
ëª ì¸ ë¸ë¼ì°ì í¸íì± ê°ì´ 보기RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4