Solved

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

Posted on 2009-04-01
3
292 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
[X]
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
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Technology Resume 7 70
Html split(text) Part2 6 23
Glitching Slide Show 19 28
ExcelWebAddIn Connect to SQL database (Javascript or VB.net) 7 27
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 …
This article discusses how to implement server side field validation and display customized error messages to the client.
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

726 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