difference between $.getJSON and $.get

后端 未结 3 678
轮回少年
轮回少年 2020-12-14 07:41

Is there really a difference in these two calls? If you use getJSON, you still have to declare format=json in the url...

And you can do the same in

3条回答
  •  情书的邮戳
    2020-12-14 08:03

    I think the documentation explains it quite clearly!

    http://docs.jquery.com/Ajax/jQuery.get#urldatacallbacktype

    Load a remote page using an HTTP GET request.

    http://docs.jquery.com/Ajax/jQuery.getJSON#urldatacallback

    Load JSON data using an HTTP GET request.

    Remember, these are just abstractions of the .ajax method

提交回复
热议问题