स्थानीय भंडारण जावास्क्रिप्ट

कोड उदाहरण

24
0

स्थानीय भंडारण जावास्क्रिप्ट

function createItem() {
	localStorage.setItem('nameOfItem', 'value'); 
} 
createItem() // Creates a item named 'nameOfItem' and stores a value of 'value'

function getValue() {
	return localStorage.getItem('nameOfItem');  
} // Gets the value of 'nameOfItem' and returns it
console.log(getValue()); //'value';
20
0

जावास्क्रिप्ट सेट स्थानीय भंडारण मूल्य

var testObject = { 'one': 1, 'two': 2, 'three': 3 };

// Put the object into storage
localStorage.setItem('testObject', JSON.stringify(testObject));

// Retrieve the object from storage
var retrievedObject = localStorage.getItem('testObject');

console.log('retrievedObject: ', JSON.parse(retrievedObject));
5
0

प्राप्त localstorage

function get(){
    var getJson = localStorage.getItem('key')
    if(getJson){
        arrayName = JSON.parse(getJson)
    }
}
4
0

जावास्क्रिप्ट स्थानीय भंडारण

  var Item = localStorage.getItem('youritem');

अन्य भाषाओं में

यह पृष्ठ अन्य भाषाओं में है

Русский
..................................................................................................................
English
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................

इस श्रेणी में लोकप्रिय

श्रेणी में उदाहरण के साथ लोकप्रिय पृष्ठों