• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 298
  • Last Modified:

Can you set and or get a parameter from the request using JavaScript?

Is there a way in JavaScript to as you would in Java to set or get a parameter from the request?
For example:

request.getParameter("myParameterVal");
request.setParameter(myParameter, "value1");
0
jwright9
Asked:
jwright9
1 Solution
 
cyberstalkerCommented:
What kind of parameter do you want to get/set? It is possible to read/set GET variables by using window.location.search.
0
 
MorcalavinCommented:
You can get the querystring from the current url by using the window.location.href property.  You can then parse that the get the values from the querystring.

As far as setting get values or getting/setting post values, no you can't do that.  Javascript(in the browser) is a client side language.  If you need to get parameters sent to the server side script, you need to access them using the server side scripting language you are using.
0
 
jwright9Author Commented:
I was looking for a way in JavaScript to get access to the HTTPRequest that one has in J2EE JSPs and Servlets.  I was hoping to get and set Parameter values in the HTTPRequest object.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now