I am using the JQuery $.ajax post command to invoke an ajax event on my web server:
var formParams = \"fe1=y&fe2=m&fe3=m\";
$.ajax({
type: \'POS
After frustratingly trying for four hours, I found out that it is able to achieve this by setting the contentType in ajax POST as follows,
var dataToSend = {
"username" : $("#username").val(),
"password" : $("#password").val()
};
$.ajax({
type: "POST",
url: "somepage.jsp",
data: dataToSend,
contentType: "application/x-www-form-urlencoded; charset=UTF-8", //this is must
success: function(datum, msg, textStatus){
$("#result").html("" + "Status : " + msg + "
")
.fadeIn("slow");
}
});