Wouldn't it be a lot easier if there was some way to pass data when doing ajax calls, oh wait, there is, using the data
option
$.ajax({
type : "GET",
url : "Search.aspx",
data : {
action : 'GetDocumentInfoByChronicleId',
objectId : '09028139800c59e3',
Db : 'DIV_Firm'
}
});
jQuery will create the querystring for you and escape it appropriately
As a sidenote, encodeURI
is exactly what you should be using to encode a querystring containing ?
, &
etc. as encodeUriComponent
will escape those characters as well, making the querystring invalid, but the method posted above is much simpler as you don't have to worry about encoding at all.