JQuery AJAX syntax

Posted by Nick on Stack Overflow See other posts from Stack Overflow or by Nick
Published on 2009-04-23T02:02:21Z Indexed on 2010/06/10 6:42 UTC
Read the original article Hit count: 156

Filed under:
|
|
|

I am trying to find the correct syntax to pass a varible to my JQuery Post.

var id = empid;

$.ajax({
    type: "POST",
    url: "../Webservices/EmployeeService.asmx/GetEmployeeOrders",
    data: "{empid: empid}",
    contentType: "application/json; charset=utf-8",
    dataType: "json",
    success: function(result) {
        alert(result.d);
    }

I don't think the data: value is quite right. Someone set me straight?

Thanks!

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about AJAX