Home > Article > Backend Development > How to reference js in php file
#The introduction of js into php files is usually divided into two situations: the same file and external files.
1. In the same situation
You can use tags directly when introducing js in the same file, for example:
<?php echo "<script>*********</script>"; ?>
2. External files
php introduces external js files. You need to write the following content outside the body, for example:
<script src="****.js" type="javascript"></script>
The above content is for reference only!
Recommended tutorial: PHP video tutorial
The above is the detailed content of How to reference js in php file. For more information, please follow other related articles on the PHP Chinese website!