I have seen many posts but still not able to figure out why this code is not working. I have a user_dashboard.html which contains the code:-
<script>
$(document).ready(function (e) {
//e.preventDefault();
$('#search_button').click( function() {
$.get("db_test2.php", function(data, status) {
console.log("Test Log");
alert("Data:"+data+"
Status:"+status);
});
});
});
</script>
The db_test2.php is a file present in the same folder and contains the code:-
<?php
echo "This is a db test";
?>
The problem is that I am not getting any alert and no console logs are being generated.