0
The idea is this, when the user enters the application will appear to him the messages registered in the bank, but I want to appear only 1 time for him. And when he clicks to close the Alert() text box, I want you to do an INSERT in the database by passing the user, date and time of the display. I need help !!
* Script.js* - Checks for messages and returns via AJAX
$('#form-msg').ready(function(){
var form = $('#form-msg');
var callback = form.find('input[name="callback"]').val();
var callback_action = form.find('input[name="callback_action"]').val();
var usuario = form.find('input[name="message_responsible"]').val();
var type = form.find('input[name="message_type"]').val();
//console.log(type);
$.ajax({
method: 'POST',
url: 'themes/intranet_fametro/ajax/' + callback + '.ajax.php',
data: {
'callback': callback,
'callback_action': callback_action,
'message_responsible': usuario,
'message_type': type
},
dataType: 'json',
success: function(data){
var obj = eval(data);
obj.forEach(function(e){
alert('Mensagem: ' + e.message_message);
});
}
});
})
Pasta, I’ll try it ! Thank you
– Moises Abreu