To return data using jquery asynchronous request
function Showlog (account_id) {
var logss;
var ajaxurl= "/tes";
$.ajax ({
Url:ajaxurl,
method: "Get",
DataType: "JSON",
success:function (rs) {
LOGSS = rs.list;< c8/>},
error:function () {
ajaxerrorcallback ();
},
complete:function () {
Aboutbtns.prop (" Disabled ", false);
}
)
return LOGSS;
}
This will return NULL, because this is the asynchronous way to request the connection, when the execution of the return of the requested address has not returned something, so it will be empty, should be synchronized with the way to add
Async:false,
function Showlog (account_id) {
var logss;
var ajaxurl= "/test" <span id= "Transmark" ></span>;
$.ajax ({
Url:ajaxurl,
method: "Get",
DataType: "JSON",
Async:false,
success:function (rs {
LOGSS = rs.list;
},
error:function () {
ajaxerrorcallback ();
},
complete:function () {
aboutbtns.prop ("disabled", false);
}
})
return LOGSS;
}