First of all the answer of Praveen Prasad I find correct. I want only to add a little description which will be answeron the question "Why ... ?" and not "How ... ?".
If parameter which you send to the server per HTTP GET has some special characters then there can not be used in URL without encoding, so you have to use at least
url:'AjaxActions/OrderNotesUpdate.aspx?OrderID=' +
encodeURIComponent(OrderID) + '&Notes=' + encodeURIComponent($('#txtNotes').val())
Next step: you can use jQuery.param()
to encode URL parameters with respect of encodeURIComponent
and place '&' character between paramters:
$.ajax({
url:'AjaxActions/OrderNotesUpdate.aspx?' +
$.param({OrderID: OrderID, Notes: $('#txtNotes').val()}),
async:false})
or
$.ajax({
url:'AjaxActions/OrderNotesUpdate.aspx' +
data: { OrderID: OrderID, Notes: $('#txtNotes').val()},
async:false})
which place '?' between url
and data
encoded by $.param
if url
don't already contain '?' otherwise it use '&' instead.
Next: you should try to use asynchrone version of $.ajax
whenever it is possible. One needs see more parts of your code to help you. In general it should be
$.ajax({
url:'AjaxActions/OrderNotesUpdate.aspx' +
data: { OrderID: OrderID, Notes: $('#txtNotes').val()},
success:function(response) {
/* here use can use response.responseText. For examlpe you can
code which call the syncrone $.ajax before and used
the return value here */
}
})