本文摘自PHP中文网,作者爱喝马黛茶的安东尼,侵删。
一、PHPStorm调试Javascript
在PHPStorm中创建test.html
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | <!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>
|
在test.html 文件中右键。
相关推荐:《PhpStorm使用教程》
选择Debug ‘test.html' .
此时Chorme浏览器会提示安装JetBrain IDE Support。选择安装即可。
这样就可以在PHPStorm中调式js了。
如下图,在PHPstorm中按F8执行下一步。
二、PHPStorm同时调式php和js
创建php文件
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | <!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 '<br>' ;
echo 'This is php code' ;
echo 'This is php code2' ;
?>
</body>
</html>
|
其中tt为js文件
1 2 3 4 5 6 7 8 9 | var test;
var test2;
console.log( "hello world!" );
console.log( "hello world3!" );
function testClick(){
console.log( "test1" );
console.log( "test2" );
}
|
在PHPStorm配置如下:
设置好断点后启动调式即可。
以上就是phpstorm怎么用js的详细内容,更多文章请关注木庄网络博客!
相关阅读 >>
phpstorm debug设置
vscode运行js文件出现乱码
phpstorm官网地址是什么
关于phpstorm的phpdoc comments注释生成器
解决phpstorm升级后调用某些类提示phpstorm unhandled exceptions
phpstorm之优雅的调试 hyperf
phpstorm基本使用
phpstorm 快速汉化指南
phpstorm中怎么同时修改很多一样的部分
phpstorm软件配置php语言的版本
更多相关阅读请进入《phpstorm》频道 >>
转载请注明出处:木庄网络博客 » phpstorm怎么用js