?
Solved

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

Posted on 2009-04-01
3
Medium Priority
?
294 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 2000 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

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

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

This article discusses how to create an extensible mechanism for linked drop downs.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

801 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