Simple example to play with cross-site scripting.
Last active
January 26, 2016 06:57
-
-
Save jonasfj/fe6b87f8aa8ce0fcd66e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <b>Hi, <span id="name"></span>,</b><br> | |
| Enter your deepest secret and I'll remeber it:<br> | |
| <input type="text" id="secret"><button onClick="save()">Save</button> | |
| <script> | |
| // Load name from location.hash | |
| document.getElementById("name").innerHTML = window.location.hash; | |
| // Load existing secret | |
| document.getElementById("secret").value = (localStorage.secret || 42); | |
| // Save secret | |
| function save() { | |
| localStorage.secret = document.getElementById("secret").value; | |
| } | |
| </script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment