How to reference js in php file

王林
Release: 2023-02-24 11:16:02
Original
11365 people have browsed it

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>";
?>
Copy after login

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>
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template