109
rated 0 times
[
116]
[
7]
/ answers: 1 / hits: 180227
/ 15 Years ago, fri, december 25, 2009, 12:00:00
How to get value of the get or post variable on page load using JavaScript?
More From » javascript
How to get value of the get or post variable on page load using JavaScript?
You can't get the value of POST variables using Javascript, although you can insert it in the document when you process the request on the server.
<script type=text/javascript>
window.some_variable = '<?=$_POST['some_value']?>'; // That's for a string
</script>
GET variables are available through the window.location.href
, and some frameworks even have methods ready to parse them.