I got a code which let me change a value in an another page using a form submit in Javascript, the problem is that the url does not accept the value @ (@ = %40 in the url)
here is the code:
index.html
<form method="GET" action="page.html">
<input type="text" id="my_text" name="my_text" />
<input type="submit" />
</form>
page.html
<input id="title"></input>
<script type="text/javascript">
function getUrlVars() {
var vars = {};
var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi,
function(m,key,value) {
vars[key] = value;
});
return vars;
}
document.getElementById("title").value = getUrlVars()["my_text"];
</script>
How can I fix this problem?