惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Attack and Defense Labs
Attack and Defense Labs
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
The Last Watchdog
The Last Watchdog
B
Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Google DeepMind News
Google DeepMind News
The GitHub Blog
The GitHub Blog
博客园_首页
N
News and Events Feed by Topic
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Security Archives - TechRepublic
Security Archives - TechRepublic
Y
Y Combinator Blog
Vercel News
Vercel News
T
Troy Hunt's Blog
L
LINUX DO - 最新话题
H
Hacker News: Front Page
云风的 BLOG
云风的 BLOG
Hugging Face - Blog
Hugging Face - Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
aimingoo的专栏
aimingoo的专栏
Recorded Future
Recorded Future
Jina AI
Jina AI
人人都是产品经理
人人都是产品经理
Microsoft Azure Blog
Microsoft Azure Blog
Last Week in AI
Last Week in AI
T
The Exploit Database - CXSecurity.com
T
The Blog of Author Tim Ferriss
S
Schneier on Security
Project Zero
Project Zero
MyScale Blog
MyScale Blog
博客园 - 聂微东
F
Fortinet All Blogs
AWS News Blog
AWS News Blog
W
WeLiveSecurity
L
LangChain Blog
N
Netflix TechBlog - Medium
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
T
Tailwind CSS Blog
Scott Helme
Scott Helme
S
Secure Thoughts
A
Arctic Wolf
The Register - Security
The Register - Security
C
Check Point Blog
Security Latest
Security Latest
O
OpenAI News
S
Securelist
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Blog — PlanetScale
Blog — PlanetScale
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events

博客园 - 我就是那个王小明

git修改历史提交记录名字 gitbase配置两个git仓库源头地址 yarn dev 或者 npm run dev 或node -v 等报错:'node' 不是内部或外部命令,也不是可运行的程序 或批处理文件。 htmlToPdf ES6 Generator使用 - 我就是那个王小明 - 博客园 数组中的每一项按照某个属性分组 - 我就是那个王小明 - 博客园 基本css拼图形 forEach时候删除数组某一属性项,使用splice容易出现问题 对于vue的一些理解 配置vuex并使用 vue搭建开发环境 一些意想不到的小bug。 小程序开发中遇到的问题 rem原理 vue使用webpack压缩后体积过大要怎么优化 分别使用ES5和ES6进行数组去重以及注意事项 nodeJS理解 package.json和bower的参数解释 Angular.js基础
前端开发快速定位bug的一些小技巧
我就是那个王小明 · 2018-11-12 · via 博客园 - 我就是那个王小明

1,根据报错信息定位:
(1) Uncaught TypeError: Cannot read property 'attr' of undefined;
此类型为变量或者对象属性未定义类型。

(2) Uncaught TypeError: a.map is not a function;
a.map不是函数,说明a不是数组,只有数组才有map方法。

(3) Uncaught SyntaxError: Invalid or unexpected token;
这种一般是js的代码格式错误。
2, 排除法
页面中一共有abcd五个方法,注释掉d后代码正常说明d有问题。

3,剥离法
同样一个方法,在A页面没问题,在B页面有问题,这时候,新建一个剥离这个组件,然后运行,如果没有异常,就算不是这个组件或者方法的问题,然后逐渐在新页面中加入可能影响B页面的条件。