I used $.getJSON to retrieve the data from my database. If the parameter dID is not null, then there is one parameter like :
$.getJSON(urlGetProByDep, { depID: dID }, function (data) {
//blah blah blah
});
But if both dID and cID are not null so the function will use 2 parameter as below :
$.getJSON(urlGetProByDep, { depID : dID,catID : cID }, function (data) {
//blah blah blah
});
Could anyone tell me how can I change the paramter in {….} due to the value of dID and cID.
Thanks so much.
1 Answer