I have two php files. The one is the main file and the second file Im including like this:
— main.php —
include('secondfile.php);
— secondfile.php —
The layout of this file looks like this. I am trying to insert an AJAX function.
<script>
myfunction()
console.log('some text to see if this works');
myfunction(){
insert AJAX call
}
</script>
Both main and secondfile.php do not include an HTML layout with head and body. Why is the code in the second file not working? Not even the console log test shows.