Can I use the following snippet,
var MSG = $("#message").val();
var dataString = 'message='+ MSG;
$.ajax({
type: "GET",
url: "InsertMessage?message="+MSG,
data: {message:MSG},
cache: false,
success: function(data)
{
$(".content").prepend(data);
$("#message").focus();
}
});
I want to send a parameter to servlet to add to the database data: {message:MSG},
sends an empty parameter