{"id":145,"date":"2020-09-04T05:59:47","date_gmt":"2020-09-04T05:59:47","guid":{"rendered":"https:\/\/imnusshof.ch\/wp\/?page_id=145"},"modified":"2023-04-01T10:20:03","modified_gmt":"2023-04-01T08:20:03","slug":"storage","status":"publish","type":"page","link":"https:\/\/imnusshof.ch\/wp\/storage\/","title":{"rendered":"STORAGE"},"content":{"rendered":"<p>&rarr; <a href=\"https:\/\/imnusshof.ch\/wp\/\">Home<\/a> &rarr; <a href=\"https:\/\/imnusshof.ch\/wp\/content\/\">Content<\/a><\/p>\n<div style=\"width:100%;height:1px;border-top:1px solid;\"><\/div>\n<p><em>&#171;With web storage, web applications can store data locally within the user&#8217;s browser.<br \/>\nBefore HTML5, application data had to be stored in cookies, included in every server request. Web storage is more secure, and large amounts of data can be stored locally, without affecting website performance. Unlike cookies, the storage limit is far larger (at least 5MB) and information is never transferred to the server.Web storage is per origin (per domain and protocol). All pages, from one origin, can store and access the same data.&#187;<\/em> [<a href=\"https:\/\/www.w3schools.com\/html\/html5_webstorage.asp\" rel=\"noopener noreferrer\" target=\"_blank\">Quelle<\/a>]<\/p>\n<p style=\"padding:1px;background-color:lightgray;\">HTML web storage provides two objects for storing data on the client:<\/p>\n<ul>\n<li>window.localStorage &#8211; stores data with no expiration date\n<li>window.sessionStorage &#8211; stores data for one session (data is lost when the browser tab is closed or the page ist reload) &rarr; <a href=\"https:\/\/imnusshof.ch\/wp\/record\/\"><strong>Beispiel<\/strong><\/a>\n<\/ul>\n<p><font size=\"112%\">The localStorage<\/font> object stores the data with no expiration date. The data will not be deleted when the browser is closed, and will be available the next day, week, or year.<\/p>\n<p><!-- ----------------------------------------------------------- --><\/p>\n<p><script>\nfunction clickCounter() {\n  if (typeof(Storage) !== \"undefined\") {\n    if (localStorage.clickcount) {\n      localStorage.clickcount = Number(localStorage.clickcount)+1;\n    } else {\n      localStorage.clickcount = 1;\n    }\n    document.getElementById(\"result\").innerHTML = \"You have clicked the Link \" + localStorage.clickcount + \" time(s).\";\n  } else {\n    document.getElementById(\"result\").innerHTML = \"Sorry, your browser does not support web storage...\";\n  }\n}\n<\/script><\/p>\n<p>&rarr; <a onclick=\"clickCounter()\" style=\"cursor:pointer;color:darkred;\">Click me!<\/a><\/p>\n<div id=\"result\"><\/div>\n<p>Click the Link to see the counter increase. Close the browser tab (or window), and try again, and the counter will continue to count &#8211; until you will delete the browsers history.<\/p>\n<p><!-- ----------------------------------------------------------- --><\/p>\n<div style=\"width:100%;height:1px;border-bottom:1px solid black;\"><\/div>\n<div style=\"margin:0;width:100%;height:600px;\"><iframe loading=\"lazy\" src=\"https:\/\/thaynger.ch\/localstorage-editable.php\" frameborder=\"0\" width=\"100%\" height=\"600\"><\/iframe><\/div>\n<p><strong>Anwendung<\/strong>:<br \/>\nSch\u00fclerInnen schreiben ihren Text in einem solcherart definierten div container (Textfeld) und bestimmen selbst, wie lang sie ihn behalten wollen.<\/p>\n<p><!-- ----------------------------------------------------------- --> <\/p>\n","protected":false},"excerpt":{"rendered":"<p>&rarr; Home &rarr; Content &#171;With web storage, web applications can store data locally within the user&#8217;s browser. Before HTML5, application data had to be stored in cookies, included in every [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"ngg_post_thumbnail":0,"episode_type":"","audio_file":"","podmotor_file_id":"","podmotor_episode_id":"","cover_image":"","cover_image_id":"","duration":"","filesize":"","filesize_raw":"","date_recorded":"","explicit":"","block":"","itunes_episode_number":"","itunes_title":"","itunes_season_number":"","itunes_episode_type":"","footnotes":""},"class_list":["post-145","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/imnusshof.ch\/wp\/wp-json\/wp\/v2\/pages\/145","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/imnusshof.ch\/wp\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/imnusshof.ch\/wp\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/imnusshof.ch\/wp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/imnusshof.ch\/wp\/wp-json\/wp\/v2\/comments?post=145"}],"version-history":[{"count":61,"href":"https:\/\/imnusshof.ch\/wp\/wp-json\/wp\/v2\/pages\/145\/revisions"}],"predecessor-version":[{"id":6934,"href":"https:\/\/imnusshof.ch\/wp\/wp-json\/wp\/v2\/pages\/145\/revisions\/6934"}],"wp:attachment":[{"href":"https:\/\/imnusshof.ch\/wp\/wp-json\/wp\/v2\/media?parent=145"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}