I have a textbox that takes in a vartitle and generates that vartitle into an HTML encoded variable that is passed into my url for ajax.
Here is an example of my string of parameters passed to my ajax call:
method=savecat&templatename=percentdistribution&dropzone=Column_1&datasetid=31&subjectid=28&varnumber=1155&origin=&codes=1@0@&values=Satisfied%20with%20job%20overall@Not%20satisfied%20with%20job%20overall@&vartitle=%26%23&missingvalues=-3,-7,-9
As you can see at the end, vartitle=%26%23.
For the example above, I typed &# into my textbox. That sequence of &# does something to break my ajax call. If I type anything else, the ajax works perfectly.
What am I missing?
My ajax call is below:
function SendAjax(webPageName, queryParams, triggerFunction)
{
alert(queryParams); //is the string mentioned above
alert(webPageName); //is the valid page name: BGPPS.aspx
var date = new Date();
var unique = date.getDay() + date.getHours() + date.getMinutes() + date.getSeconds() + date.getMilliseconds();
$.ajax(
{
type: "POST",
url: webPageName,
data: queryParams+'&'+unique,
success: triggerFunction
});
}