I am trying to send a variable through an ajax post statement as shown below.
var variable1 = "";
var variable2 ="tree";
$.ajax
{
url: webServiceURL + "AddTask",
type: "POST",
data: { ID: variable1 , Value: variable2 }
})
When this is run for some reason the ajax request is dropping variable1 as if it doesn't exist. I was hoping there would be a way to force the call to send variable1's data as "". I can make changes to the back end and send null instead of "" but would really rather not have to do that as it will make things a bit more messy.
As adeneo mentioned it was to do with my backend. I have had to instead send data back as null and then have this changed to an empty string.