Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

can we acess post/get data using javascript only?

How can we access the variable which is submitted such as

<form methord='get' action='sdsd.html'>

using javascript?

like image 759
Varada Avatar asked May 14 '11 06:05

Varada


2 Answers

POST values are not accessible client side.

GET values can be accessed via

window.location.search
like image 179
Gal Avatar answered Nov 01 '22 10:11

Gal


Values that have been "posted" with GET are now in the querystring. You could parse the querystring with JS to get the values.

Here is a general example: Parse Querystring with JS

like image 29
Bazzz Avatar answered Nov 01 '22 12:11

Bazzz