Solved

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

Posted on 2009-04-01
3
293 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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
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 embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

691 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