Click to See Complete Forum and Search --> : how we pass more than one parameter in ajax.request


vkdixit
03-23-2009, 06:56 AM
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)
{
alert('great');
return false;
}
});

vkdixit
03-23-2009, 06:59 AM
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)
{
alert('great');
return false;
}
});
vkdixit is online now Add to vkdixit's Reputation Report Post Edit/Delete Message

NogDog
03-23-2009, 11:34 AM
Looks like you need an "&" before "comment=comm...".

Kuriyama
03-23-2009, 12:15 PM
Looks like you are using a JavaScript API to generate the AJAX call. Probably prototype if I'm guessing correctly. Format your AJAX calls like this. . .


new Ajax.Request(ajaxURLPath + 'getCustomers.asp',{
method: 'post',
parameters: {
attributes: attributes,
bool: bool,
search_terms: search_terms,
logic: logic,
page: pageNumber,
count: pageCount,
orderby: orderby,
order: order,
cols: selectedCols
},
//Truck in the HTML structure and add some effects to the table.
onSuccess: function(transport){
$('page_results').innerHTML = transport.responseText;
$('errors').innerHTML = '';
$$('.table_grid_border tr').each(function(s, index){
highlightTableRow(s, index);
});
}


The parameters attribute will build a query string for you based on what parameters you are passing in.