Varada
Varada

Reputation: 17052

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?

Upvotes: 8

Views: 17639

Answers (2)

Gal
Gal

Reputation: 5907

POST values are not accessible client side.

GET values can be accessed via

window.location.search

Upvotes: 7

Bazzz
Bazzz

Reputation: 26922

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

Upvotes: 6

Related Questions