Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing more than 1 parameter in Ajax.request

Status
Not open for further replies.

softjack

Programmer
Dec 4, 2005
44
IN
Hi

i'm using Ajax

Here is the code
Code:
var pars = "Circle=" + stateValue;
    //alert(stateValue);
    var myAjax = new Ajax.Request(url, {method: 'get', parameters: pars,
        onComplete: showResponse});
}

i want to pass more than one parameter how can i do that?

Please help!

Softjack
 
Not really sure what this has to do with JSP - its more of a javascript question really.

Anyhow, you could do it like :

var anotherParam = "hello";

var pars = "Circle=" + stateValue +"&someotherparam=" +anotherParam;

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
Hi,

The other solution from sedj's is using prototype.js

Code:
 <script language="javascript">
   // $H creates a HashMap similar to Java
   var params = $H({
                   Circle:"circleValue",
                   other:"otherValue",
                   other2:"other2Value"
                }); 
  var myAjax = new Ajax.Request(url, {method: 'get', parameters: params.toQueryString(),
        onComplete: showResponse});
 </script>

Cheers
Venu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top