1
When loading a page, I have two Ajax requests in sequence that fill two select s with options coming from different tables in the database.
But only the first is executed, the second does not even call. I already followed with debug, I put breakpoint to see if the second request enters and does not work.
Both are independent. Follow the code:
function Inicio(){
// Primeira requisição que é executada
$.get('ctrl/administrativo/modcadcon.ctrl.php',
{'acao':'todos_atv', 'campo':'mod_status', 'valor':'1'},
function(ret_mod){
// Preenche o select com o resultado
}
);
// Segunda requisição não é executada
$.get('ctrl/administrativo/procadcon.ctrl.php',
{'acao':'consultar', 'campo':'pro_status', 'valor':'1'},
function(ret_pro){
// Não chega aqui...!
}
);
}
[RESOLVED]
There was an error in the PHP script that received the second request... Now they both work.
Already put a console.log in the second to see if there is action?
– Sam
Also note if there was a javascript error when running the page, because when this happens, the rest of the code that exists after the error does not run.
– Marcell Alves
@sam e @Marcell Alves - the time that comes on the second line
$.get...
, following with debug, it does not run. There must be something wrong here. The php file exists... it is very strange that.– Rodrigo Tognin