Difference Between $.getJSON() and $.ajax() in jQuery

后端 未结 7 2435
星月不相逢
星月不相逢 2020-11-27 11:48

I am calling an ASP.NET MVC action

public JsonResult GetPatient(string patientID)
{
...

from JavaScript using jQuery. The following call wo

7条回答
  •  隐瞒了意图╮
    2020-11-27 12:22

    There is lots of confusion in some of the function of jquery like $.ajax, $.get, $.post, $.getScript, $.getJSON that what is the difference among them which is the best, which is the fast, which to use and when so below is the description of them to make them clear and to get rid of this type of confusions.

    $.getJSON() function is a shorthand Ajax function (internally use $.get() with data type script), which is equivalent to below expression, Uses some limited criteria like Request type is GET and data Type is json.

    Read More .. jquery-post-vs-get-vs-ajax

提交回复
热议问题