1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
<!DOCTYPE HTML> <html> <body> <script> if (('sessionStorage' in window) && window.sessionStorage !== null){ try { sessionStorage.setItem('name', 'user1'); } catch (e) { parent.fail('setItem method is failed.'); } sessionStorage.clear(); } else { parent.fail('sessionStorage is not supported.'); } </script> </body> </html>