Get the App
SLTechnology News&Howtos  ›  Development  › 

Which is the better underlying function than getjson and what are its advantages?

Shulou Source: shulou.com Published: 2022-06-03 07:49:46 11月12日 Update

In this issue, Xiaobian will bring you about which underlying function is better than getjson and what advantages it has. The article is rich in content and analyzes and narrates from a professional perspective. After reading this article, I hope you can gain something.

The code is as follows:

$.ajax({

type: "GET",

url: desturl,

success:function(data) {

if(data!= '') {

linfo[xss_clean]=data;

}

loadimg.style.display="none";

// addTableListener(document.getElementById("tbColor"),0,0);

},

error: function(){

alert("asynchronous query error");

loadimg.style.display="none";

},dataType:"json"

});

The advantage is that if there is a problem with the network, you can tell the user that there is an error through the error method, and if you use the getjson function, you cannot handle this error.

The above is the bottom function that Xiaobian shares for everyone is better than getjson, which is what and what advantages, if there is a similar doubt, may wish to refer to the above analysis to understand. If you want to know more about it, please pay attention to the industry information channel.

Tags: Advantages functions bottom layer content analysis specialty small and medium code rich content can be passed that is articles methods more users knowledge articles networks industries perspectives Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei MySQL macOS Shulou Technology Redmi