Does anybody here knows how do I use jQuery.param to create an object with a list of phone numbers and how do I supose to recover that in classical ASP?
I use $.ajax to send to an ASP page the parametres. Usually what I do is something like that:
var p = {
cod: cod.val(),
name: name.val()
};
var param = jQuery.param(p);
$.ajax({
type: "POST",
url: "SomeASP.asp",
data: param
});
I using var param = jQuery.param(p); because my string can contain any character, like & or ? or spaces. And than I recover the information at “SomeASP.ASP” by doing this:
Dim cod, name
cod = Request("cod")
name= Request("name")
The main problem is: Now I have to send a list o phone numbers to “SomeASP.asp”.
I read the documentation and notice that I can send a more complex object than I demonstrate above, but I have no idea of how to send and to recover these items.
I appreciate any help! Sorry for my poor english.
[]’s
You do not need
jQuery.param(p);.Simply do:
In this case jQuery will serialize
pcorrectly and on server side you will be able to doUPD:
Not sure how ASP will handle such request. In asp.net it would be:
Possibly something like that you will need to do in classic asp.
But if no, you may join phone numbers on client:
var p = {
cod: cod.val(),
name: name.val()
};
p.phones = [‘phone1’, ‘phone2’].join(“,”)//you should receive string like “phone1,phone2”
$.ajax({
type: “POST”,
url: “SomeASP.asp”,
data: p
});
and than on server side: