Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

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

Posted on 2009-04-01
3
291 Views
Last Modified: 2012-05-06
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
Comment
Question by:jwright9
3 Comments
 
LVL 10

Expert Comment

by:cyberstalker
ID: 24041723
What kind of parameter do you want to get/set? It is possible to read/set GET variables by using window.location.search.
0
 
LVL 18

Accepted Solution

by:
Morcalavin earned 500 total points
ID: 24041788
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
 

Author Comment

by:jwright9
ID: 24041871
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

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question