What is the Diff between type and method in ajax

HI i have used both the things in my experience i was thinking method and type both are POST and GET methods.

But seems like they are not similar.?

if i use type it is working i am serializeing a form data..

if i write method it is not working can can anyone explain what is the diff between them..?

$.ajax({
  url: "controller.php",
  type: 'POST',
  method: "POST",
  dataType: "json",
});

help is appropriated.

Answers:

Answer

type (default: 'GET') Type: String An alias for method. You should use type if you're using versions of jQuery prior to 1.9.0.

http://api.jquery.com/jquery.ajax/

Answer

From: http://api.jquery.com/jquery.ajax/

method:

The HTTP method to use for the request (e.g. "POST", "GET", "PUT"). (version added: 1.9.0)

type:

An alias for method. You should use type if you're using versions of jQuery prior to 1.9.0.
Answer

both are same, in new version of jQuery type renamed to method

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.