HTML and CSS Reference
In-Depth Information
the user refreshes the page, views the ad on another site, or even closes the browser, the name will show in the ad unit
again until the data is cleared or modified.
By refreshing the browser, you should see something similar to the image in Figure 6-4 .
Figure 6-4. A localStorage ad example with a user's name
If you see something similar to what's in the figure, great work! If not, rereview the code and give it another shot.
Modern web browsers even have tools to help you. By using the web inspector and heading to the Resources tab, you
can take a look at all the storage items being held by the browser. Figure 6-5 shows what this looks like using Google's
Chrome browser. (There will be more on data storage and measurement in Chapter 10.)
Figure 6-5. The localStorage web inspector view on Google's Chrome browser
 
Search WWH ::




Custom Search