You are here: irt.org | FAQ | JavaScript | Link | Q870 [ previous next ]
If you actually want to set this value to the value of a JavaScript variable then:
<script language="JavaScript"><!-- var variableName = 'Hello world'; //--></script> <a href="newpage.html" onClick="this.href='newpage.html?' + variableName">Linked page</a>
To retrieve it in newpage.html:
<script language="JavaScript"><!-- var variableName = null; if (location.search.length > 0) variableName = location.search.substring(1); function functionName(text) { alert(text); } functionName(variableName); //--></script>