JQuery AJAX syntax

0 votes

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!

Jun 15 in JQuery by gaurav
• 17,400 points
32 views

1 answer to this question.

0 votes

Syntax: $. ajax(url); $. ajax(url,[options]);
jQuery ajax() Method.

answered Jun 16 by rajatha
• 7,040 points

Related Questions In JQuery

0 votes
1 answer

How to import jQuery UI using ES6/ES7 syntax?

Hii, Add a alias in webpack config: resolve: { ...READ MORE

answered Apr 28, 2020 in JQuery by Niroj
• 82,740 points
5,198 views
0 votes
1 answer

What is the difference between AJAX with JavaScript and jQuery?

JavaScript is a programming language. JQuery is ...READ MORE

answered May 30 in JQuery by gaurav
• 17,400 points
69 views
0 votes
1 answer

Download pdf file using jquery ajax

Download PDF file with button click using ...READ MORE

answered May 30 in JQuery by gaurav
• 17,400 points
1,275 views
0 votes
1 answer

Download a file by jQuery.Ajax

Downloading files using AJAX method $("#FileDownloadBtn"). click(function () ...READ MORE

answered Jun 10 in JQuery by gaurav
• 17,400 points
157 views
0 votes
1 answer

jQuery AJAX submit form

There is a simple input mentioned below ...READ MORE

answered Feb 8 in Java by Soham
• 8,740 points
247 views
0 votes
1 answer

TypeError: $.ajax(...) is not a function?

Please double-check if you're using the full-version ...READ MORE

answered Feb 22 in Others by Aditya
• 7,300 points
462 views
0 votes
1 answer

jQuery Ajax error handling, show custom exception messages

Make sure you're setting Response.StatusCode to something other than ...READ MORE

answered Jun 2 in JQuery by Edureka
• 13,640 points
143 views
0 votes
0 answers

Edit PHP query code depending on image map clicked area using AJAX

I am working on an image map ...READ MORE

Jun 3 in PHP by Kichu
• 19,040 points
22 views
0 votes
1 answer

Ajax using JQuery in ASP .NET c#

jQuery Ajax in ASP.Net $.ajax({      & ...READ MORE

answered Jun 15 in JQuery by rajatha
• 7,040 points
47 views
0 votes
1 answer

Abort Ajax requests using jQuery

Instead of aborting, you can choose to ...READ MORE

answered Jun 16 in JQuery by rajatha
• 7,040 points
32 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP