Why does $.getJSON silently fail?

前端 未结 5 1090
闹比i
闹比i 2020-12-02 11:16

It seems very inconvenient that jQuery\'s $.getJSON silently fails when the data returned is not valid JSON. Why was this implemented with silent failure? What is the easies

5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-02 12:02

    You should have a look at the docs for this API... it has a .error on it.

    http://api.jquery.com/jQuery.getJSON/

提交回复
热议问题