Home > Development Tools > phpstorm > How to use js in phpstorm

How to use js in phpstorm

爱喝马黛茶的安东尼
Release: 2019-08-19 09:31:48
Original
4802 people have browsed it

How to use js in phpstorm

1. PHPStorm debugging Javascript

Create test.html in PHPStorm

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Test page</title>
    <script>
       var test;
       var test2;
       console.log("hello world!");
       console.log("hello world3!");
    </script>
</head>
<body>
<p>Test</p>
</body>
</html>
Copy after login

In Right click on the test.html file.

Related recommendations: "PhpStorm Usage Tutorial"

How to use js in phpstorm

##Select Debug 'test.html' .

This Chrome browser will prompt to install JetBrain IDE Support. Just choose to install.

This way you can adjust js in PHPStorm.

As shown below, press F8 in PHPstorm to execute the next step.

How to use js in phpstorm

2. PHPStorm adjusts php and js at the same time

Create php file

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Test page</title>
    <script src="tt.js" ></script>
</head>
<body>
<p>Test</p>
<a onclick="testClick()">test click</a>
<?php
echo  &#39;<br>&#39;;
echo &#39;This is php code&#39;;
echo &#39;This is php code2&#39;;
?>
</body>
</html>
Copy after login

where tt Configure the js file

var test;
var test2;
console.log("hello world!");
console.log("hello world3!");
 
function testClick(){
    console.log("test1");
    console.log("test2");
}
Copy after login
in PHPStorm as follows:

How to use js in phpstorm

Set the breakpoint and start the debugging.

The above is the detailed content of How to use js in phpstorm. 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