Jump to content

Local storage


Ata

Recommended Posts

I got this code now.

 

<script type="text/javascript"> document.write("<input type='text' value='' onclick='alert('message')' />"); document.write("<input type='text' value='' onclick='alert('message')' />");document.write("<input type='text' value='' onclick='alert('message')' />");</script>

How can I save this on my server with local storage? I want if I type something in the input field that I can save it, and when I refresh it is still there.

 

Link to comment
Share on other sites

have you read the documentation on local storage?

http://www.html5rocks.com/en/features/storage

 

It doesn't store it on the server, it stores it on the client (i.e. the users browser). This may be the same means to and end for you, depending on your requirements.

 

More importantly, I would question your use of document.write. Any particular reason you are using it instead of just an HTML document with the elements already on the page?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...