aboutsummaryrefslogtreecommitdiff
path: root/files/de/web/api/storage/length/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'files/de/web/api/storage/length/index.html')
-rw-r--r--files/de/web/api/storage/length/index.html63
1 files changed, 63 insertions, 0 deletions
diff --git a/files/de/web/api/storage/length/index.html b/files/de/web/api/storage/length/index.html
new file mode 100644
index 0000000000..767ef0c21b
--- /dev/null
+++ b/files/de/web/api/storage/length/index.html
@@ -0,0 +1,63 @@
+---
+title: Storage.length
+slug: Web/API/Storage/length
+tags:
+ - API Eigenschaft Storage
+translation_of: Web/API/Storage/length
+---
+<p>{{APIRef("Web Storage API")}}</p>
+
+<p>Die <code>length</code>-Eigenschaft der {{domxref("Storage")}}-Schnittstelle enthält die Anzahl der im <code>Storage</code>-Objekt gespeicherten Datensätze.</p>
+
+<h2 id="Syntax">Syntax</h2>
+
+<pre class="syntaxbox">var <em>aLength</em> = <em>Storage</em>.length;</pre>
+
+<h3 id="Rückgabewert">Rückgabewert</h3>
+
+<p>Ein Integer.</p>
+
+<h2 id="Beispiel">Beispiel</h2>
+
+<p>Die folgende Funktion fügt drei Datensätze hinzu und liest abschließend die Anzahl der vorhandenen Datensätze:</p>
+
+<pre class="brush: js">function populateStorage() {
+ localStorage.setItem('bgcolor', 'yellow');
+ localStorage.setItem('font', 'Helvetica');
+ localStorage.setItem('image', 'cats.png');
+
+ localStorage.length; // sollte 3 zurückgeben
+}</pre>
+
+<div class="note">
+<p><strong>Hinweis</strong>: Weitere Beispiele sind im <a href="https://mdn.github.io/dom-examples/web-storage/">Web-Storage-Demo</a> zu finden.</p>
+</div>
+
+<h2 id="Spezifikation">Spezifikation</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">Spezifikation</th>
+ <th scope="col">Status</th>
+ <th scope="col">Kommentar</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('HTML WHATWG', 'webstorage.html#dom-storage-length', 'Storage.length')}}</td>
+ <td>{{Spec2('HTML WHATWG')}}</td>
+ <td> </td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Browserkompatibilität">Browserkompatibilität</h2>
+
+
+
+<p>{{Compat("api.Storage.length")}}</p>
+
+<h2 id="Siehe_auch">Siehe auch</h2>
+
+<ul>
+ <li><a href="/en-US/docs/Web/API/Web_Storage_API/Using_the_Web_Storage_API">Using the Web Storage API</a></li>
+</ul>