Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function PostsCategoriasListar(table, select, callback) {
- if (table) {
- $.ajax({
- url: controller_dashboard,
- type: 'POST',
- dataType: 'json',
- data: {acao: 'PostsCategoriasListar', Listar: 'table'},
- success: function(response) {
- if (response.status === 'LogOff') {
- window.setTimeout(function() {
- window.location.reload();
- }, 10000);
- }
- $element.find('table tbody').html(response.table);
- ExecuteDataTable(0, maximo, 1);
- },
- error: function(error) {
- console.log(error);
- }
- });
- }
- if (select) {
- $.ajax({
- url: controller_dashboard,
- type: 'POST',
- dataType: 'json',
- data: {acao: 'PostsCategoriasListar', Listar: 'select'},
- success: function(response) {
- if (response.status === 'LogOff') {
- window.setTimeout(function() {
- window.location.reload();
- }, 10000);
- }
- $element.find('form select').html(response.select);
- },
- error: function(error) {
- console.log(error);
- }
- });
- }
- //EU QUERO QUE O CALLBACK SO EXECULTE DEPOIS QUE TODO CODIGO QUE ESTIVER NOS IF'S ACIMA TENHAN TERMINADO, ELE SEMPRE EXECULTA ANTES ONDE ESTOU ERRANDO?
- if (typeof callback === 'function')
- callback();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement