Is it possible to change a javascript variable through the URL?
Here's an example of the code I'm trying to modify from a website. (www.example.com
)
<script type="text/javascript">
var x = 0;
</script>
I want to change the variable x
from 0
to 1
.
I want to do this by appending something to the URL. I'm not sure about the syntax, but I think it may be something like this:
www.example.com#javascript: var=1;
Is it possible to change variable x
by only modifying the URL?
EDIT: The duplicate question doesn't tell me how (if it's possible) to change the variable through the URL. Please let me know if that's not the case.
Related Question: https://security.stackexchange.com/questions/134240/modify-javascript-variable-with-url-exploit