博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
PHPStorm 调式JS /同时调式PHP和jS
阅读量:7122 次
发布时间:2019-06-28

本文共 1214 字,大约阅读时间需要 4 分钟。

PHPStorm 调式JS /同时调式PHP和jS

一、PHPStorm 调式Javascript

在PHP Storm中创建test.html

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<!
DOCTYPE 
html>
<
html 
lang="en">
<
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 文件中右键

选择Debug ‘test.html' .

此时Chorme浏览器会提示安装JetBrain IDE Support。选择安装即可。

这样就可以在PHPStorm 中调式js了。

如下图,在PHp storm中按F8执行下一步

 参考 

 

二、PHP Storm同时调式php和js

创建php文件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<!DOCTYPE html>
<html lang=
"en"
>
<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"
);
}

在PHP Storm配置如下:

设置好断点后启动调式即可。

源码链接:http://pan.baidu.com/s/1ge4IBRl 密码:be62

参考

本文转自Work Hard Work Smart博客园博客,原文链接:http://www.cnblogs.com/linlf03/p/5910289.html,如需转载请自行联系原作者

你可能感兴趣的文章
你的资产在哪里 - where-are-your-assets
查看>>
Android Ant之打包项目,增加zipalign
查看>>
训练计划,水题
查看>>
Android之开发常用颜色
查看>>
TROUBLE SHOOTING: FRM-30425
查看>>
《Two Dozen Short Lessons in Haskell》(二十二)递归
查看>>
前端性能优化:DocumentFragments或innerHTML取代复杂的元素注入
查看>>
derby支持的数据类型
查看>>
使用MFC CImage类绘制PNG图片时遇到的问题
查看>>
Spring Autowire自动装配
查看>>
设置Linux可以查看历史命令的执行时间
查看>>
ASP.NET之旅—再一次与ASP谋面
查看>>
CCToggleVisibility和CCPlace
查看>>
用ISA2006配置单网卡缓存服务器
查看>>
CSS预处理器之SASS用法指南
查看>>
开源下载工具
查看>>
OllyUni.dll
查看>>
VS2008远程调试
查看>>
Cracking the coding interview--Q2.2
查看>>
brew 中的时间格式转换
查看>>