JS files can call JS functions, but cannot call PHP functions. Calling functions in other JS files must include the source of the function to be called. JS files are executed on the client, and PHP is executed on the server. The role of js is to provide the response and get the value of the php file.
Write a function in the js file and it will be automatically executed when the source is referenced.
$(function(){
alert("ggg");
})
The above introduces js files and php files, including related content. I hope it will be helpful to friends who are interested in PHP tutorials.