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

后端 未结 7 2468
星月不相逢
星月不相逢 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

    .getJson is simply a wrapper around .ajax but it provides a simpler method signature as some of the settings are defaulted e.g dataType to json, type to get etc

    N.B .load, .get and .post are also simple wrappers around the .ajax method.

提交回复
热议问题