What do you want to save?
Add Code snippet
New code examples
-
TypeScript 2022-01-29 10:47:31
how to Store 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 -
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-21 22:10:24
save in local storage with expiration
function getWithExpiry(key) { const itemStr = localStorage.getItem(key) // if the item doesn't exist, return null if (!itemStr) { return null } const item = JSON.parse(itemStr) const now = new Date() // compare the expiry time of the item with th... 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