I need a client side browser database in HTML5. What are my options?

JavascriptWeb DevelopmentFront End Scripts

You can use local storage in HTML5 for this purpose. The Local Storage is designed for storage that spans multiple windows and lasts beyond the current session. In particular, Web applications may wish to store megabytes of user data, such as entire user-authored documents or a user's mailbox, on the client side for performance reasons.

<!DOCTYPE HTML>
<html>
   <body>
      <script>
         if( localStorage.hits ){
            localStorage.hits = Number(localStorage.hits) +1;
         } else{
            localStorage.hits = 1;
         }
         document.write("Total Hits :" + localStorage.hits );
      </script>
      <p>Refresh the page to increase number of hits.</p>
      <p>Close the window and open it again and check the result.</p>
   </body>
</html
raja
Published on 05-Apr-2018 17:05:25
Advertisements