What do you want to save?
Add Code snippet
New code examples
-
Javascript 2022-01-23 05:35:54
js pass data between pages
//first page var favoritemovie = "Shrek"; sessionStorage.setItem("favoriteMovie", favoritemovie); //second page var favoritemovie = sessionStorage.getItem("favoriteMovie"); console.log(favoritemovie); Add solution -
Javascript 2022-01-22 20:40:08
how to check if a user is logged in javascript
jQuery(window).load(function() { //Set the login session sessionStorage.setItem('status','loggedIn') }); //Check the login session if (sessionStorage.getItem('status') != null)) //redirect to page console.log('You are logged in'); } else{ ... Add solution -
Other 2021-11-22 01:36:24
bootstrap keep tab open cookie
$(function() { // for bootstrap 3 use 'shown.bs.tab', for bootstrap 2 use 'shown' in the next line $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) { // save the latest tab; use cookies if you like 'em better: l... Add solution -
Other 2021-11-19 04:09:23
datatables keep order and page selection page refresh
$('#offersTable').dataTable({ "bStateSave": true, "fnStateSave": function (oSettings, oData) { localStorage.setItem('offersDataTables', JSON.stringify(oData)); }, "fnStateLoad": fun... Add solution -
Javascript 2021-11-19 03:53:16
js local storage
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.lo... Add solution -
Javascript 2021-11-16 12:01:08
angular open new tab from component
In case someone runs into the same issue I ran: I ended using localstorage to temporarily store my object and access it from the other window. So the code ended up like: <a target="_blank" [routerLink]="['/details', item.name]" c... Add solution -
TypeScript 2021-11-15 03:01:11
Storing Objects in HTML5 localStorage
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.lo... Add solution -
Javascript 2021-11-14 18:15:16
what is Window local storage
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 'nameOfIt... Add solution
Best helpers
Ranking is empty