By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,385 Members | 1,767 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,385 IT Pros & Developers. It's quick & easy.

prepare URI for multiple values with same parameter name.

dmjpro
100+
P: 2,476
I want to prepare a URI having a parameter name which contains multiple values.
How do I prepare that URI in JS?
I mean how browser send those multiple values?
Please Help me!

Debasis Jana.
Jul 5 '08 #1
Share this Question
Share on Google+
5 Replies


hsriat
Expert 100+
P: 1,654
How do you want to send those parameters?
If you are using AJAx for the same, use a variable the required URI and pass it to the xmlHttp.open function or in other case, use window.location = uri_variable;.
Expand|Select|Wrap|Line Numbers
  1. var uri_variable = 'mysite.com/index.php?a=' + a + '&b=' + b;  
Jul 5 '08 #2

dmjpro
100+
P: 2,476
How do you want to send those parameters?
If you are using AJAx for the same, use a variable the required URI and pass it to the xmlHttp.open function or in other case, pass this as an argument to window.location function.
Expand|Select|Wrap|Line Numbers
  1. var uri = 'mysite.com/index.php?a= ' + a + '&b=' + b;  
Now Suppose .... i want to send multiple values against parameter "a".
So that i can use "request.getParameterValues" (for JSP).
You got what i meant?

Debasis Jana
Jul 5 '08 #3

dmjpro
100+
P: 2,476
Now Suppose .... i want to send multiple values against parameter "a".
So that i can use "request.getParameterValues" (for JSP).
You got what i meant?

Debasis Jana
I got the solution, what a fake question i made.
it will be page?parameter_name=parameter_value&parameter_name =parameter_value......
actually i got from my self ..simply make the request GET and ..submit the page ..and have a look at the address bar of the browser.

Debasis Jana .... So shamed of me!
Jul 5 '08 #4

hsriat
Expert 100+
P: 1,654
I got the solution, what a fake question i made.
it will be page?parameter_name=parameter_value&parameter_name =parameter_value......
actually i got from my self ..simply make the request GET and ..submit the page ..and have a look at the address bar of the browser.

Debasis Jana .... So shamed of me!
In JSP and ASP, multiple GET variables with same name makes an array at the server end.
In PHP, square braces, [ ] are needed (like variable[ ]) to make it an array.
Jul 5 '08 #5

acoder
Expert Mod 15k+
P: 16,027
I got the solution, what a fake question i made...[snip]... So shamed of me!
Not necessarily. Sometimes, by typing out your problem, it let's you think about it more and you figure it out yourself.
Jul 5 '08 #6

Post your reply

Sign in to post your reply or Sign up for a free account.