I have this where edit_FName & edit_LName represent asp.net textboxes:
$.ajax({
type: "POST",
url: document.URL + "/EditName",
data: "{fName:'" + edit_FName.val() + "'" +
",lName:'" + edit_LName.val() + "'}",
And I need it to allow for both single and double quotes in the names. I Kinda figure I need to use stringify but I cannot get it to behave the way I want. I tried:
$.ajax({
type: "POST",
url: document.URL + "/EditName",
data: "{fName:'" + JSON.stringify(edit_FName.val()) + "'" +
",lName:'" + JSON.stringify(edit_LName.val()) + "'}",
etc...
but that doesn't work at all so I guess I don't have an understanding of how I'm supposed to use stringify to put together the data.