本文摘自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的详细内容,更多文章请关注木庄网络博客!
相关阅读 >>
php怎么更好的利用phpstorm的自动提示
怎么用phpstorm做表格
win10下phpstorm如何进行docker开发
phpstorm读取文本文件出现乱码
phpstorm突然打开不了是什么情况?
phpstorm 如何使用 xdebug 调试代码
vscode运行js文件出现乱码
关于phpstorm中如何绘画uml的解析
怎么在vscode中调试js代码
phpstorm 最新版本破解方法
更多相关阅读请进入《phpstorm》频道 >>
转载请注明出处:木庄网络博客 » phpstorm怎么用js