I have two parameters (categoryName and categoryDescription) that I need to pass to the web service using JSON. I found the syntax to pass categoryName but have not been able to get the correct syntax to pass both parameters. Here is the code.
<script src="js/jquery-1.4.1.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
$('#hbtnCreateCategory').click(function(event) {
$.ajax({
type: "POST",
url: "lwsServiceData.asmx/CreateHelpDeskCategory",
data: "{'categoryName': '" + $('#categoryName').val() + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(msg) {
AjaxSucceeded(msg);
},
error: AjaxFailed
});
});
function AjaxSucceeded(result) {
alert(result.d);
$('#result').val = result.d;
}
function AjaxFailed(result) {
alert(result.status + ' ' + result.statusText);
}
});
</script>
Thanks in advance.