locked
jquery ajax make call type of Get or Post by default ? RRS feed

  • Question

  • User264732274 posted

    jquery ajax make call type of Get or Post by default ?

    $.ajax({
        url: "/YourController",
        cache: false,
        dataType: "html",
        success: function(data) {
            $("#content").html(data);
        }
    });

    in the above code no where Get or Post has been set..........so what is default ?

    Wednesday, March 2, 2016 12:15 PM

Answers

  • User264732274 posted

    ok got it. default is Get.

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

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, March 2, 2016 2:47 PM

All replies

  • User475983607 posted

    You've asked the question in the past...

    See the openly published JQuery reference documentation.

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

    Wednesday, March 2, 2016 1:44 PM
  • User264732274 posted

    ok got it. default is Get.

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

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, March 2, 2016 2:47 PM