I have a web application on javascript/php and I'm making a bug finder function, a button on the front-end where the user can inform a bug. The current function:
function bug_finder(){
var txt = document.getElementById('bug_txt').value;
if(txt==''){
alert_fail('Um campo ficou vazio!');
return;
}
var DATA = { acao:'bug_finder', txt:txt, log:console.log };
console.log( JSON.stringify(DATA) );
$.ajax({
type: "POST",
url: 'dash_acao.php',
timeout:2000,
data: DATA,
success: function(response){
console.log(response);
alert_sucesso('');
},
error: function(response){
alert_fail('');
}
});
}
The ajax sends the console.log content of the browser to a php file where I do database updates and create the log file in the server so I can look it up.
Until now I have not found a way to get the console.log from the browser into data, so I can manipulate.