O'Reilly logo

Instant HTML5 Local Storage How-to by Alex Libby

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using Local Storage to hide sign-up forms (Become an expert)

If you browse on the Internet and register for access to a site, you would be more than a little irritated if the same site kept prompting you to register, wouldn't you? This is one of my pet hates. We can easily fix this with the help of Local Storage, as you will see in this recipe.

How to do it...

Perform the following steps, for using Local Storage to hide sign-up forms:

  1. Let's begin by creating our basic framework. Add the following to a new HTML document, and save it as hideform.html:
    <!DOCTYPE html>
    <html>
      <head>
        <meta charset="utf-8">
        <title>Hiding a sign-up form demo</title>
      </head>
      <body>
      </body>
    </html>
  2. We need to add references to Modernizr, jQuery, and our custom script. We're ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required