diff options
Diffstat (limited to 'files/he/web/api/storage/key/index.html')
-rw-r--r-- | files/he/web/api/storage/key/index.html | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/files/he/web/api/storage/key/index.html b/files/he/web/api/storage/key/index.html new file mode 100644 index 0000000000..9dfce0e52b --- /dev/null +++ b/files/he/web/api/storage/key/index.html @@ -0,0 +1,55 @@ +--- +title: Storage.key() +slug: Web/API/Storage/key +translation_of: Web/API/Storage/key +--- +<p>{{APIRef("Web Storage API")}}</p> + +<p>פונקציית <strong><code>()key</code></strong> מאפשרת לאחזר את שם המפתח באמצעות אינדקס.</p> + +<h2 id="תחביר">תחביר</h2> + +<pre class="syntaxbox">var <em>aKeyName</em> = <em>storage</em>.key(<em>index</em>);</pre> + +<h3 id="פרמטרים">פרמטרים</h3> + +<dl> + <dt><em>index</em></dt> + <dd>מספר שלם המייצג את מיקום המפתח שברצוננו לאחזר.</dd> +</dl> + +<h3 id="ערך_חוזר">ערך חוזר</h3> + +<p>במידה והמפתח קיים באחסון המקומי הוא יחזיר את שמו. במידה והמפתח אינו קיים יוחזר הערך null.</p> + +<h2 id="דוגמאות">דוגמאות</h2> + +<p>הפונקציה הבאה חוזרת על פריטי האחסון המקומיים ומקבלת את הערך שהוגדר עבור כל מפתח:</p> + +<pre class="brush: js">for(var i =0; i < localStorage.length; i++){ + console.log(localStorage.getItem(localStorage.key(i))); +} +</pre> + +<h2 id="מפרט">מפרט</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">Specification</th> + <th scope="col">Status</th> + <th scope="col">Comment</th> + </tr> + <tr> + <td>{{SpecName('HTML WHATWG', 'webstorage.html#dom-storage-key', 'Storage.key')}}</td> + <td>{{Spec2('HTML WHATWG')}}</td> + <td> </td> + </tr> + </tbody> +</table> + +<h2 id="Browser_compatibility">Browser compatibility</h2> + + + +<p>{{Compat("api.Storage.key")}}</p> |