JavaScript-da ob'ektlarni yaratishning qanday usullari mavjud. Object constructor


Download 352.42 Kb.
bet6/11
Sana11.03.2023
Hajmi352.42 Kb.
#1261155
1   2   3   4   5   6   7   8   9   10   11
Bog'liq
JavaScript

Local storage

Session storage

Accessed on client or server side

Both server-side & client-side

client-side only

client-side only

Lifetime

As configured using Expires option

until deleted

until tab is closed

SSL support

Supported

Not supported

Not supported

Maximum data size

4KB

5 MB

5MB

  • localStorage va sessionStorage o'rtasidagi asosiy farq nima

    LocalStorage SessionStorage bilan bir xil, lekin u brauzer yopilgan va qayta ochilganda ham maʼlumotlarni saqlab qoladi (yaʼni uning amal qilish muddati yoʻq), seansStorageʼda esa sahifa seansi tugashi bilan maʼlumotlar tozalanadi.

    1. What are the methods available on session storage

    // Save data to sessionStorage
    sessionStorage.setItem("key", "value");

    // Get saved data from sessionStorage


    let data = sessionStorage.getItem("key");

    // Remove saved data from sessionStorage


    sessionStorage.removeItem("key");

    // Remove all saved data from sessionStorage


    sessionStorage.clear();


    1. Download 352.42 Kb.

      Do'stlaringiz bilan baham:
      1   2   3   4   5   6   7   8   9   10   11




      Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
      ma'muriyatiga murojaat qiling