I have the following array:
var idParam = ["1","2","3"];
I want to send this data as a request using jQuery.ajaxwhat I am doing:
$.ajax({
type: "GET",
url: "Services/GetInfo.ashx",
data: { "id": idParam },
contentType: "application/text",
dataType: "json",
success: function(result)
{
...
},
error: function(XMLHttpRequest, textStatus, errorThrown)
{
...
}
});
But as a result, I have the following ugly line: ?id[]=1&id[]=2&id[]=4(actually it is much uglier :) id%5B%5D=1&id%5B%5D=2&id%5B%5D=4.
What to do to get a normal line like: id=1&id=2&id=4?? Thanks
source
share