Is there a list of JavaScript or jQuery error codes (the kind which, for example, MySQL and MariaDB have)?
I have received an Error 5001
, and I have no idea what it means. Will elaborate, if it turns out to be necessary.
EDIT
The reason I'm asking is this. A webapp which I'm partially involved in has recently started returning unusual responses from jQuery AJAX calls. Response is
Error 5001
I have never seen something like this before, and googling for a solution returned this old link.
Even after receiving steps to reproduce the error, my team and I haven't been able to do so.
The code is setup like this:
jQuery
$('#someId').on('change',function() {
var id = $('#otherId').val(); // this is a hidden input field
$.ajax({
url: 'ajax/check.php',
type: 'post',
data: {valId:id}
async: true,
success: function(data) {
if(data=="ok") {
$('#someId').removeClass('blue').addClass('green');
} else {
$('#someId').removeClass('green').addClass('blue');
}
},
error: function(desc, err) {
console.log("Details: "+ JSON.stringify(desc) + "
Error: " + JSON.stringify(err);
}
});
});
PHP
$id = preg_replace('/\D/','',(int)$_POST['id']);
if($id < 1 || $id != $_POST['id']) {
echo "no";
die();
}
$date = date('Y-m-d H:i:s');
$mysqli->query("UPDATE mytable SET dateupdated = '".$date."' WHERE id = $id");
if($mysqli->affected_rows < 1) {
echo "no.";
die();
}
echo "ok";
Error logging has been disabled globally, and there's nothing from the PHP side of things, which would printout this error.
If it's of any relevance, the server on which the app is hosted has recently started responding sluggishly, and returning a query such as
SELECT * FROM users ORDER BY datemodified DESC LIMIT 10
requires the users to wait for up to 3 minutes. The database has been optimized and repaired when these issues starting happening, but that didn't help. DB has also been tested on two other unrelated servers (same PHP and MariaDB version), and the same query performed quickly, as expected.
https://docs.microsoft.com/en-us/scripting/javascript/reference/javascript-run-time-errors - This might be what you are looking for if you are doing something with Windows Apps.
In your case Error 5001 could be - 5001 Number expected
After doing an extensive search through all the files in the entire webapp, it turned out that the error came from a custom error handler in an old custom JS library. Apologies for wasting everybody's time.