Created
June 2, 2020 15:31
-
-
Save FlokiTV/4789a7c8f8a8552a5b883d605301657d to your computer and use it in GitHub Desktop.
asynFunc.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://developer.mozilla.org/pt-BR/docs/Web/JavaScript/Reference/Statements/funcoes_assincronas | |
function recuperarDadosdeSessao(){ | |
return new Promisse( resolve => { | |
$.ajax({ | |
url:'../resource/Sessoes/Sessoes.php', | |
type:'GET', | |
dataType:'json', | |
success: function(retorno){ | |
resolve(retorno) | |
}, | |
error: function(retorno){ | |
resolve(retorno) | |
} | |
}); | |
}) | |
} | |
// USANDO | |
dados = await recuperarDadosdeSessao() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment