programing

Ajax의 유형과 메서드 간 차이는 무엇입니까?

subpage 2023. 3. 5. 09:48
반응형

Ajax의 유형과 메서드 간 차이는 무엇입니까?

안녕하세요, 저는 지금까지의 경험에서 POST와 GET 두 가지 방법을 모두 사용하고 있습니다.

하지만 그들은 비슷하지 않은 것 같다.

내가 사용한다면type되고 있어serializeing폼 데이터..

내가 글을 쓴다면method그것은 효과가 없다. 누가 그들 사이의 차이점을 설명할 수 있는가?

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

도움이 필요합니다.

type(기본값: 'GET') 유형: 메서드의 문자열 별칭.1.9.0 이전 버전의 jQuery를 사용하는 경우 type을 사용해야 합니다.

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

송신원: http://api.jquery.com/jquery.ajax/

방법:

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

입력:

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

새 버전의 jQuery 유형에서 둘 다 메서드로 이름이 변경되었습니다.

언급URL : https://stackoverflow.com/questions/43543174/what-is-the-diff-between-type-and-method-in-ajax

반응형