View Full Version : how we pass more than one parameter in ajax.request

03-23-2009, 12:52 PM
Hi all,
Plz help me how we pass the parameter in ajax.request and get the oncomplete text...........

var ajaxc = new Ajax.Request('/bc/krnlAddComment1.asp?ID=<%=request("ID")%>comment=comm&name=myname',{
method: 'get',
parameters: 'true',
onSuccess: function handleresponsemess(request)
return false;

03-23-2009, 01:09 PM
I'm guessing this is from a JS framework of some sorts.
Java is not the same as javascript. Moving to AJAX forum.

03-23-2009, 03:30 PM
that looks like prototype to me.

what exactly are you trying to accomplish?

03-24-2009, 04:28 AM
I'm assuming the OP is referring to sending the query string data, namely ID, comment and name to the request. As Fou-Lu mentioned, this is obviously a call to some framework's Ajax request, so the documentation on that framework should spell it out. For example, here's how you would do it in jquery:

$.ajax( {
type : "POST",
url : theUrl,
data : "ID=theID&comment=comment&name=theName",
success : function(data) {
failure : function(err) {
} );

03-25-2009, 03:07 PM
ooohh... don't attach your parameters to your url string. the url string should just be your target file. you CAN technically do it that way i think... but i'd suggest following the api docs. instead of using parameters = "true" (which isn't right) use parameters: 'ID=<%=request("ID")%>comment=comm&name=myname'

the returned text will be in transport.responseText


var ajaxc = new Ajax.Request('/bc/krnlAddComment1.asp',{
method: 'get',
parameters: 'ID=<%=request("ID")%>comment=comm&name=myname',
onSuccess: function (transport)


EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum